aboutsummaryrefslogtreecommitdiff
path: root/test cases/unit
AgeCommit message (Collapse)AuthorFilesLines
2022-05-03Add some scaffolding needed for C++ modules in GCC.gccmodulesJussi Pakkanen13-0/+96
Further work pending GCC bug #105467 and/or Ninja bug #1962.
2022-05-03Move Visual Studio module test to its own subdir.Jussi Pakkanen13-14/+21
2022-05-01Merge pull request #10039 from eli-schwartz/wayland-protocols-subproject-filesJussi Pakkanen1-3/+3
dependencies: allow get_variable to expose files from subprojects
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-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-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-29Condense test directory names.Jussi Pakkanen308-0/+0
2022-03-24Make compilers list per subprojectXavier Claessens1-1/+1
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-16unittests: convert python tests to project testsEli Schwartz5-109/+0
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-09install: Add --strip optionXavier Claessens2-0/+4
2022-03-07Fix default install tag for shared lib symlinksXavier Claessens1-0/+6
Versioned shared libraries should have .so file in devel, .so.1 and .so.1.2.3 in runtime. Fixes: #9811
2022-02-28Allow setting method/separator in environment() and meson.add_devenv()Xavier Claessens2-1/+6
2022-02-28devenv: Set PYTHONPATH where we install python modulesXavier Claessens5-1/+36
2022-01-02Condense test directory numbers for rc1.Jussi Pakkanen32-0/+0
2021-11-24shared_module: Add soname when used as a link targetNirbheek Chauhan2-0/+18
Emit a detailed deprecation warning that explains what to do instead. Also add a unittest. ``` DEPRECATION: target prog links against shared module mymod, which is incorrect. This will be an error in the future, so please use shared_library() for mymod instead. If shared_module() was used for mymod because it has references to undefined symbols, use shared_libary() with `override_options: ['b_lundef=false']` instead. ``` Fixes https://github.com/mesonbuild/meson/issues/9492
2021-11-24unit tests: Extend prebuilt test to test intermediateDylan Baker5-1/+47
This provides coverage for the bug: https://github.com/mesonbuild/meson/issues/9542
2021-11-02python.dependency(): Do not stop when first candidate is not foundXavier Claessens1-0/+4
It has to lookup the dependency with required=False otherwise it raises an exception when the first candidate (pkg-config) failed.
2021-10-30Added warning if run_command is called without the check kwargVolker Weißmann4-8/+8
2021-10-27Fix add_install_script() ignoring install_tagXavier Claessens1-0/+3
Fixes: #9454
2021-10-01rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker3-0/+32
Otherwise changes to a dependency don't propogate
2021-09-30Make custom_target() name argument optionalXavier Claessens3-0/+23
2021-09-28Merge pull request #9014 from bonzini/mixed-language-linkJussi Pakkanen2-0/+12
Use appropriate compiler for the source file for "links" tests with file argument
2021-09-27fix test case instances where undefined message(true) occurredEli Schwartz1-1/+1
2021-09-21Add platform agnostic testsXavier Claessens3-0/+8
This adds a new category of tests that does not need to run on all platforms during CI. For now only run them on Linux runners because they are not the bottleneck.
2021-09-16Fix ignored install_tag kwarg in install_subdir()Xavier Claessens2-0/+5
Fixes: #9263
2021-09-07unittests: test external dependency in summaryPaolo Bonzini1-0/+1
This requires a bit of extra code because the version might change, but otherwise it fits in the existing AllPlatformTests.test_summary testcase Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-07add test case for mixed language link testsPaolo Bonzini2-0/+12
2021-09-06mintro: add installed_planFilipe LaĆ­ns16-0/+42
Signed-off-by: Filipe LaĆ­ns <lains@riseup.net>
2021-09-02interpreter: Add summary of all user defined optionsXavier Claessens1-1/+1
It is a commonly needed information to help debugging build issues. We already were printing options with non-default value at the end of the configure but outside of the summary. Keeping the list of user defined options in the interpreter will also in the future be useful to use new default value on reconfigure.
2021-09-01run_target: do not yield broken names with subdirsEli Schwartz2-0/+8
A run_target object created in a subdir/meson.build always has a ninja rule name of "name", not "subdir/name". Fixes #9175
2021-08-31pylint: turn on superflous-parensDylan Baker4-9/+9
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-30decorators: Make unknown kwarg fatalXavier Claessens1-1/+1
2021-08-17Add install tagsXavier Claessens9-0/+92
Fixes: #7007.
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz27-30/+7
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-08-09interpreter: Fix missing subsubproject summary when subproject failsXavier Claessens2-1/+5
In the case main->subp->subsubp, if subsubp succeed to configure but subp subsequentially fails, subsubp is still being built but its summary was missing.
2021-08-09pkg-config: support for `-l:libfoo.a`lilinzhe5-0/+67
fixs: #9000 Meson not correctly process with -l:xxx.a link arguments in pkgconfig .pc file. see also:https://stackoverflow.com/questions/48532868/gcc-library-option-with-a-colon-llibevent-a with unit test, unit test will be partially skiped if pkg-config version < 0.28 . see: https://gitlab.freedesktop.org/pkg-config/pkg-config/-/blob/master/NEWS
2021-07-25ast: Add dummy "support" for fstrings in the ast packageDaniel Mensinger1-0/+2
2021-07-21Fix meson.version().version_compare() regression in subprojectXavier Claessens2-0/+10
2021-07-15Condense test directory names for next release.Jussi Pakkanen2-0/+0
2021-04-26Condense test directory names.Jussi Pakkanen153-0/+0
2021-04-26introspection: export all sources for custom targetsJason Francis1-3/+8
Also adds some test cases for source files in target_sources.
2021-04-26store the list of initializes subprojects in the coredata structureDylan Baker2-0/+5
We need to konw on rconfigure which options have already bee set not just for the super project, but also for the subproject. However, using first_invocation is not sufficient, as a reconfigure could add a new subpproject that wasn't present before, and we need to initialize that project's builtins.
2021-04-26Interpreter: Fallback when required is false but forcefallback is trueXavier Claessens2-0/+11
2021-03-29Do not add custom target dir automatically when implicit false.Jussi Pakkanen6-0/+43
2021-03-23environment(): Allow stacking append() and prepend() (#8547)Xavier Claessens2-21/+0
* environment(): Allow stacking append() and prepend() * Update docs/markdown/Reference-manual.md Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
2021-03-18Allow add_dist_script() in subprojectsXavier Claessens5-0/+27
Fixes: #8440.
2021-03-16clangformat: Add include and ignore filesXavier Claessens7-0/+17
2021-03-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens5-0/+50
2021-03-04use python2-compatible syntax because needed on macOSEli Schwartz1-2/+2
Apparently this unittest runs on macOS using the system python2.