summaryrefslogtreecommitdiff
path: root/test cases/unit
AgeCommit message (Collapse)Author
2022-04-19unittests: Add test_pkgconfig_relocatable to allplatformstestsFredrik Salomonsson
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 Schwartz
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 Scholz
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 Pakkanen
2022-03-24Make compilers list per subprojectXavier Claessens
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 Schwartz
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 Schwartz
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 Claessens
2022-03-07Fix default install tag for shared lib symlinksXavier Claessens
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 Claessens
2022-02-28devenv: Set PYTHONPATH where we install python modulesXavier Claessens
2022-01-02Condense test directory numbers for rc1.Jussi Pakkanen
2021-11-24shared_module: Add soname when used as a link targetNirbheek Chauhan
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 Baker
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 Claessens
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ßmann
2021-10-27Fix add_install_script() ignoring install_tagXavier Claessens
Fixes: #9454
2021-10-01rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker
Otherwise changes to a dependency don't propogate
2021-09-30Make custom_target() name argument optionalXavier Claessens
2021-09-28Merge pull request #9014 from bonzini/mixed-language-linkJussi Pakkanen
Use appropriate compiler for the source file for "links" tests with file argument
2021-09-27fix test case instances where undefined message(true) occurredEli Schwartz
2021-09-21Add platform agnostic testsXavier Claessens
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 Claessens
Fixes: #9263
2021-09-07unittests: test external dependency in summaryPaolo Bonzini
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 Bonzini
2021-09-06mintro: add installed_planFilipe Laíns
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-02interpreter: Add summary of all user defined optionsXavier Claessens
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 Schwartz
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 Baker
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 Claessens
2021-08-17Add install tagsXavier Claessens
Fixes: #7007.
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz
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 Claessens
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`lilinzhe
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 Mensinger
2021-07-21Fix meson.version().version_compare() regression in subprojectXavier Claessens
2021-07-15Condense test directory names for next release.Jussi Pakkanen
2021-04-26Condense test directory names.Jussi Pakkanen
2021-04-26introspection: export all sources for custom targetsJason Francis
Also adds some test cases for source files in target_sources.
2021-04-26store the list of initializes subprojects in the coredata structureDylan Baker
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 Claessens
2021-03-29Do not add custom target dir automatically when implicit false.Jussi Pakkanen
2021-03-23environment(): Allow stacking append() and prepend() (#8547)Xavier Claessens
* 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 Claessens
Fixes: #8440.
2021-03-16clangformat: Add include and ignore filesXavier Claessens
2021-03-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens
2021-03-04use python2-compatible syntax because needed on macOSEli Schwartz
Apparently this unittest runs on macOS using the system python2.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-02-26interpreter: correctly track whether a subproject is initializedDylan Baker
The way the tracking is currently done it works if no new subprojects are added to a configured build directory. For cases where we want to add a new subproject, it fails because we don't initialize builtins for that subproject. This corrects that by checking to see if the subproject already exists, and if it doesn't initializes the bultins for it. Fixes: #8421