aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
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
2022-03-18tests: make python2 dependency on 32-bit windows non-fatalEli Schwartz1-6/+18
Apparently Azure provides 64-bit python2 when we try to test 32-bit, and that breaks everything on the 32-bit test runner. I don't understand the environment setup, and that runner is disappearing soon anyway. Hopefully this shuts up the known breakage.
2022-03-17tests: don't skip python version tests if python is found but its dep is brokenEli Schwartz1-10/+6
If a version of python is installed for testing against, we should assume it's actually important to test against it.
2022-03-16unittests: convert python tests to project testsEli Schwartz6-0/+13
Perhaps when this test case was originally created, project tests could not use a matrix of options? This is certainly possible today, so don't write special unittest handling for this instead. This adds proper visibility into what gets run and what doesn't. Now we know which python executables got tested and which got skipped.
2022-03-15Revert "devenv: Set PYTHONPATH where we install python modules"Eli Schwartz5-36/+1
This reverts commit 79c6075b560dbf1c3e4e0b30f1c472dc2086421e. # Conflicts: # docs/markdown/snippets/devenv.md # mesonbuild/modules/python.py # test cases/unit/91 devenv/test-devenv.py PYTHONPATH cannot be reliably determined. The standard use case for installing python modules with Meson is mixed pure sources (at least `__init__.py`) and compiled extension_modules or configured files. Unfortunately that doesn't actually work because python will not load the same package hierarchy from two different directories, one a source directory and one a (mandatory) out of tree build directory. (It kind of can, but you need to do what this test case accidentally stumbled upon, which is namespace packages. Namespace packages are a very specific use case and you are NOT SUPPOSED to use them outside that use case, so people are not going to use them just to circumvent Meson devenv stuff as that would have negative install-time effects.) Adding PYTHONPATH anyway will just lead to documentation commitments which we cannot actually uphold, and confusing issues at time of use because some imports *will* work... and some will *not*. The end result will be a half-created tree of modules which just doesn't work together at all, but because it partially works, users attempting to debug it will spend time wondering why parts of it do import. For any case where the automatic devenv would work correctly, it will also work correctly to use `meson.add_devenv()` a single time, which is very easy to manually get correct and doesn't provide any significant value to automate. In the long run, an uninstalled python package environment will require "editable installs" support.
2022-03-14sourceset: reinstate extra_depsPaolo Bonzini1-2/+2
Dependencies in the "if_true" keyword argument do not prevent the sources from being used; in other words, they work just like dependencies with "disabler: false". However, this was broken in commit ab0ffc6a2 ("modules/sourceset: Fix remaining typing issues", 2022-02-23) which changed logic instead of just fixing typing issues. This was likely an attempt to avoid using "dependencies.Dependency" after the "dependencies" field was declared, but it also broke QEMU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-13Merge pull request #9339 from dcbaker/submit/structured_sourcesJussi Pakkanen13-0/+139
Structured Sources
2022-03-12fix regression in vcs_tag when the VCS program is not installedEli Schwartz1-0/+6
We are supposed to fallback on the fallback when running the vcstagger, but instead we errored out during configure. Fixes regression in commit b402817fb6f0392812bfa272bdbc05c9c30139fa. Before this, we used shutil.which || relative paths, and in the latter case if it could not be found we still wrote out that path but it failed to run in vcstagger. Now, we use find_program under the hood, so it needs to be run in non-fatal mode, and if it is not found, we simply keep the original command string. It's a VCS command, so if we magically end up finding it at runtime because it was installed after running configure, that is *fine*.
2022-03-09Move dataonly pkgconfig file to datadir/pkgconfigTristan Partin1-2/+2
dataonly files are architecture independent (lib vs lib64 for example). Fixes #9902
2022-03-09install: Add --strip optionXavier Claessens2-0/+4
2022-03-08tests: bitcode: add missing b_bitcode optionMarvin Scholz1-1/+2
The bitcode test did not actually have bitcode enabled, making it not really useful.
2022-03-07Fix @typed_pos_args on java.generate_native_headersTristan Partin5-17/+33
2022-03-07Add support for rust proc-macro cratesDylan Baker4-1/+35
2022-03-07tests/rust: Add a test for structured inputsDylan Baker13-0/+139