aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2022-06-09intro-install_plan: fix destinations for build_targets with custom install_dirEli Schwartz1-0/+4
There are a couple issues that combine to make the current handling a bit confusing. - we call it "install_dir_name" but it is only ever the class default - CustomTarget always has it set to None, and then we check if it is None then create a different variable with a safe fallback. The if is useless -- it cannot fail, but if it did we'd get an undefined variable error when we tried to use `dir_name` Remove the special handling for CustomTarget. Instead, just always accept None as a possible value of outdir_name when constructing install data, and, if it is None, fall back to {prefix}/outdir regardless of what type it used to be.
2022-06-07wrap: Add support for applying a list of patch filesPaweł Marczewski5-0/+96
Co-authored-by: Xavier Claessens <xavier.claessens@collabora.com>
2022-06-05add D generated files to order-only depsRemi Thebault4-0/+41
2022-06-01Fix sandbox violation when using subproject as a symlinkVili Väinölä4-0/+21
Fix "Tried to grab file outside current (sub)project" error when subproject exists within a source tree but it is used through a symlink. Using subprojects as symlinks is very useful feature when migrating an existing codebase to meson that all sources do not need to be immediately moved to subprojects folder.
2022-05-31fix regression that broke type checking of CustomTarget outputsEli Schwartz1-1/+1
We validate a few things here, such as the non-presence of '@INPUT' in an output name. These got moved out of the CustomTarget constructor in commit 11f96380351a88059ec55f1070fdebc1b1033117 and into KwargInfo, but only for kwargs that took multiple values. This caused configure_file() and unstable_rust.bindgen() to stop checking for this. Add a shared single-output KW and use it in both places. This now dispatches to _output_validator. configure_file now validates subdirectories in output names the same way we do elsewhere, directly in the typed_kwargs and by specifying the erroring kwarg.
2022-05-30Implement `preserve_path` for install_headersFlorian "sp1rit"​3-3/+9
The `install_headers` function now has an optional argument `preserve_path` that allows installing multi-directory headerfile structures that live alongside sourcecode with a single command. For example, the headerfile structure headers = [ 'one.h', 'two.h', 'alpha/one.h', 'alpha/two.h', 'alpha/three.h' 'beta/one.h' ] can now be passed to `install_headers(headers, subdir: 'mylib', preserve_path: true)` and the resulting directory tree will look like {prefix} └── include    └── mylib       ├── alpha       │   ├── one.h       │   ├── two.h       │   └── three.h       ├── beta       │   └── one.h       ├── one.h       └── two.h Fixes #3371
2022-05-24cmake: Add test caseDaniel Mensinger2-0/+5
2022-05-19Add cc.has_function_attribute('sentinel')Tristan Partin1-0/+1
2022-05-19Add cc.has_function_attribute('section')Tristan Partin1-0/+1
2022-05-19Reword message in warningZbigniew Jędrzejewski-Szmek4-5/+5
"targetting" is verb-derived adjective, which sort-of-works here, but makes the whole sentence awkward, because there's no verb. Let's just use present simple.
2022-05-19Reword misleading warningZbigniew Jędrzejewski-Szmek4-5/+5
"tried to use" implies that the attempt was not successful, i.e. that meson ignored the feature. But that is not what happens, apart from the warning the feature works just fine. The new message is also shorter ;)
2022-05-10Require CMake 3.14 for all tests that use the cmake moduleSimon McVittie5-17/+7
Older versions are not supported by the cmake module since 0.62. This avoids having to hard-code the linux-bionic-gcc CI job as being unable to run these tests, which leaves other older environments like Debian 10 still trying to run them (and failing). Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-08compilers/c++: Add MSVC option to make the __cplusplus define accurateEli Schwartz3-1/+22
Otherwise it always returns the value for c++98, starting with MSVC 2017 15.7 or later. Earlier versions are not affected by this mis-feature. See: https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160 This was originally applied as 0b97d585480e973d8b149618901f7a4ddfa1a906 but later reverted because it made the CI red. Try it again, now. Original-patch-by: Dylan Baker <dylan@pnwbakers.com> Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-05-06Add some scaffolding needed for C++ modules in GCC.Jussi Pakkanen13-0/+96
Further work pending GCC bug #105467 and/or Ninja bug #1962.
2022-05-06Move Visual Studio module test to its own subdir.Jussi Pakkanen13-14/+21
2022-05-03dependencies: handle one more case of subproject installed filesEli Schwartz4-0/+10
Some projects treat meson.project_source_root() as the root of the dependency files, because the project itself merely wraps a bunch of datafiles. Our validation to make sure this doesn't point to another subproject, made use of pathlib.Path's generator for all component paths, which... did not include the path itself. So go ahead and explicitly check that too. Add a test case to verify it while we are at it. Fixes https://github.com/mesonbuild/meson/pull/10103#issuecomment-1114901033
2022-05-03add testcase for bad things with add_project_dependenciesPaolo Bonzini10-0/+53
Test that add_project_dependencies() can only be used before build targets have been declared. Also test that one cannot use override_dependency on a superproject to inject a superproject's build products into the subproject. This would violate the rule that build products cannot be used with add_project_dependencies() (similar to e.g. compiler.has_function), so check that meson detects the situation correctly.
2022-05-03interpreter: new function add_project_dependencies()Paolo Bonzini4-0/+43
This function can be used to add fundamental dependencies such as glib to all build products in one fell swoop. This can be useful whenever, due to a project's coding conventions, it is not really possible to compile any source file without including the dependency. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-01Add support for multiline f-stringsPeter Lesslie2-1/+49
+ Extend the parser to recognize the multiline f-strings, which the documentation already implies will work. The syntax is like: ``` x = 'hello' y = 'world' msg = f'''This is a multiline string. Sending a message: '@x@ @y@' ''' ``` which produces: ``` This is a multiline string. Sending a message: 'hello world' ``` + Added some f-string tests cases to "62 string arithmetic" to exercise the new behavior.
2022-05-01Convert if...error checks to assert() in string arithmetic testsPeter Lesslie1-11/+3
2022-05-01Merge pull request #10039 from eli-schwartz/wayland-protocols-subproject-filesJussi Pakkanen17-3/+121
dependencies: allow get_variable to expose files from subprojects
2022-04-30use D compiler to check pointer size in test d/14Remi Thebault1-2/+2
2022-04-30implement and test a few compiler checks for DRemi Thebault2-0/+67
- run - sizeof - alignment - has_header
2022-04-23Do not use 'echo' as it is not available on plain cmd.exeJussi Pakkanen4-4/+10
2022-04-21Allow deprecating an option for a new oneXavier Claessens2-0/+13
2022-04-20vcs_tag: handle non-str / non-file argumentsKirill Isakov1-1/+15
This makes vcs_tag behave like other commands so it accepts not only string and file arguments, but also exe, custom_tgt, and external_program.
2022-04-20vcs_tag: document the already supported file argKirill Isakov2-0/+8
2022-04-20Fix purelib and platlib validation in Python3 module.Jussi Pakkanen1-2/+4
2022-04-19unittests: Add test_pkgconfig_relocatable to allplatformstestsFredrik Salomonsson1-0/+15
Test that the pkgconfig prefix is actually relocatable when pkgconfig.relocatable=true and is not when pkgconfig.relocatable=false.
2022-04-19test cases/failing: Add 123 pkgconfig not relocatable outside prefixFredrik Salomonsson2-0/+30
Which will check that meson errors out when the install_dir for the pkgconfig file is outside the install prefix.
2022-04-18Fix generator expression list problems (fixes #10288)Daniel Mensinger1-1/+1
2022-04-13dependencies: move DependencyVariableString handling to declare_dependencyEli Schwartz5-3/+16
This allows tracking which subproject it came from at the time of definition, rather than the time of use. As a result, it is no longer possible for one subproject which knows that another subproject installs some data files, to expose those data files via its own declare_dependency.
2022-04-13dependencies: allow get_variable to expose files from subprojectsEli Schwartz14-0/+105
There are somewhat common, reasonable and legitimate use cases for a dependency to provide data files installed to /usr which are used as command inputs. When getting a dependency from a subproject, however, the attempt to directly construct an input file from a subproject results in a sandbox violation. This means not all dependencies can be wrapped as a subproject. One example is wayland-protocols XML files which get scanned and used to produce C source files. Teach Meson to recognize when a string path is the result of fetching a dep.get_variable(), and special case this to be exempt from subproject violations. A requirement of this is that the file must be installed by install_data() or install_subdir() because otherwise it is not actually representative of what a pkg-config dependency would provide.
2022-04-13dependencies: tighten type checking and fix cmake API violation for get_variableEli Schwartz1-3/+3
dep.get_variable() only supports string values for pkg-config and config-tool, because those interfaces use text communication, and internal variables (from declare_dependency) operate the same way. CMake had an oddity, where get_variable doesn't document that it allows list values but apparently it miiiiiight work? Actually getting that kind of result would be dangerously inconsistent though. Also, CMake does not support lists so it's a lie. Strings that are *treated* as lists with `;` splitting don't count... We could do two things here: - raise an error - treat it as a string and return a string It's not clear what the use case of get_variable() on a maybe-list is, and should probably be a hard error. But that's controversial, so instead we just return the original `;`-delimited string. It is probably the wrong thing, but users are welcome to cope with that somehow on their own.
2022-04-12qt dependency: find the correct -qtX configtool nameEli Schwartz1-2/+2
Fixes regression in commit c211fea51389728783cf59ae41156a5e0de9c41a. The original dependency lookup looked for `qmake-{self.name}`, i.e. `qmake-qt5`, but when porting to config-tool, it got switched to `qmake-{self.qtname}` i.e. `qmake-Qt6`, which was bogus and never worked. As a result, if `qmake-qt5` and `qmake` both existed, and the latter was NOT qt5, it would only try the less preferred name, and then fail. We need to define self.name early enough to define the configtool names, which means we need to set it before running the configtool __init__() even though configtool/pkgconfig would also set it to the same value. Mark the tests as passing on two distros that were failing to detect qmake due to this issue, and were marked for skipping because we assumed that the CI skipping there was an expected case rather than an old regression.
2022-04-12tests: fix incomplete Qt 6 supportStefan Hajnoczi4-3/+33
The "frameworks/4 qt" test covers Qt 4 and 5. There is already Qt 6 code in the test but it is incomplete because translations are missing and Qt 6 requires C++17 or later to compile.
2022-04-03cmake: Better error message when configuring a CMake subproject fails.Daniel Mensinger3-0/+23
2022-04-01Fix CMake error messageDaniel Mensinger1-2/+2
2022-03-30Add new debug() functionMarvin Scholz1-0/+4
Adds a new debug() function that can be used in the meson.build to log messages to the meson-log.txt that will not be printed to stdout when configuring the project.
2022-03-29gnome: Fix gtkdoc when using multiple Apple frameworksJan Tojnar2-1/+7
The `-framework Foundation -framework CoreFoundation` ended up de-duplicated by OrderedSet into `-framework Foundation CoreFoundation`.
2022-03-29Condense test directory names.Jussi Pakkanen569-86/+86
2022-03-24Make compilers list per subprojectXavier Claessens8-4/+19
Previously subprojects inherited languages already added by main project, or any previous subproject. This change to have a list of compilers per interpreters, which means that if a subproject does not add 'c' language it won't be able to compile .c files any more, even if main project added the 'c' language. This delays processing list of compilers until the interpreter adds the BuildTarget into its list of targets. That way the interpreter can add missing languages instead of duplicating that logic into BuildTarget for the cython case.
2022-03-23Add support for cython_argsTristan Partin3-0/+38
cython_args was previoously ignored by Meson.
2022-03-23add test d/14 dub with depsRemi Thebault2-0/+93
2022-03-22interpreter: Make compiler options per-subprojectXavier Claessens5-6/+32
2022-03-22tests/common/44: Prepend to PKG_CONFIG_PATh instead of replacing itDylan Baker2-4/+10
Which is required to make this test work when PKG_CONFIG_PATH is required to get a working system, such as on nixos
2022-03-22Add ability to add resources to jarsTristan Partin5-0/+48
Previously Meson lacked the ability to add resources to jar files. Fixes #9945
2022-03-21Merge pull request #10147 from dcbaker/submit/structured-sources-subdirJussi Pakkanen10-0/+31
structured_sources: fix subdir handling
2022-03-21tests/rust: renumber structred sources testDylan Baker10-0/+0
2022-03-21ninja: fix handling of rust structured_sources in rare caseDylan Baker4-0/+31
In the even that all of the inputs are generated, and they're all generated into the same folder, and there are no subfolders, we would fail to correctly handle all of the files after the main file. Let's fix that.t