aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2021-12-15rewriter: create {add,rm}_extra_files commandsCeleste Wouters4-0/+282
Add ability to mutate a target's `extra_files` list through the rewriter. The logic is copied from sources add/rm, but changes the `extra_files` kwarg instead of the sources positional argument. Has additional logic to handle creating the `extra_files` list if it doesn't exist.
2021-12-09tests/rust polyglot: we need to link with bcrypt.lib as wellDylan Baker1-1/+1
2021-12-06gnome module: deprecate passing false to install_dir_girEli Schwartz3-5/+11
Use a proper install option for this. Now `install_<type>` can directly override `install` instead of passing a boolean to the string kwarg `install_dir_<type>`.
2021-12-06gnome module: document and fix install_dir x3, by allowing false *_gir and ↵Eli Schwartz2-3/+3
*_typelib generate_gir forces building both the typelib and gir, and some people only want one or the other (probably only the typelib?) which means flagging the other as install_dir: false in the same way custom_target supports. As this always worked, albeit undocumented, make sure it keeps working. It's pretty reasonable to allow, anyway. Fixes https://github.com/mesonbuild/meson/pull/9484#issuecomment-980131791
2021-12-06interpreter: allow extract_objects to receive generated sourcesPaolo Bonzini2-0/+18
Fixes: #8333
2021-12-06allow passing a CustomTargetIndex as argument to a testPaolo Bonzini2-2/+2
Fixes: #7585 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-06pass all outputs of a custom_target as arguments to a testPaolo Bonzini2-3/+6
Meson was passing only the first output and warning about it. To do this easily, refactor construct_target_rel_path to return a list. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-01cmake: Fix old style dependency lookup with imported targetsDaniel Mensinger2-0/+14
This also includes some refactoring, since the alternaticve would have been to duplicate the huge traceparser target code block again. fixes #9581
2021-12-01add install_symlink functionPablo Correa Gómez5-0/+27
Allows installing symlinks directly from meson, which can become useful in multiple scenarios. Current main use is to help moving forward #9557
2021-11-27Merge pull request #9599 from dcbaker/submit/typed_kwargs-message-improvementsJussi Pakkanen1-1/+1
Improve error messages for typed_kwarg type mismatches in containers
2021-11-25interpreter: fix `feature.require` handling of error messageBenoit Pierre3-0/+11
Don't show a blank error when no `error_message` was passed as argument.
2021-11-24shared_module: Add soname when used as a link targetNirbheek Chauhan3-1/+19
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-23rust: clean up inputs and outputs to bindgenPaolo Bonzini4-0/+44
Make the handling of bindgen inputs consistent with the inputs and outputs of source_strings_to_files. However, for the first source argument reject anything that cannot possibly be an header file. This also fixes a mypy failure from the next patch, since ExtractedObjects does not have a zero-argument get_outputs method. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-22typed_kwargs: use | for type unions, not ,Dylan Baker1-1/+1
Python uses this syntax now, as does typescript and other languages
2021-11-22typed_kwargs: provide better error messages for wrong container typesDylan Baker1-1/+1
Currently, if you pass a `[]string`, but the argument expects `[]number`, then you get a message like `expected list[str] but got list`. That isn't helpful. With this patch arrays and dictionaries will both print messages with the types provided.
2021-11-20Feature kwargs decorator: automatically report the nodes which trigger an issueEli Schwartz1-1/+1
2021-11-20guard a complicated mlog.warning inside a Feature checkEli Schwartz1-1/+1
This is only relevant on certain versions of meson, so do not print it when meson_version is too low. The message itself is not precisely a deprecation warning, since ostensibly it may be an unlikely coding mistake. It is probably an attempt to implement `copy: true`, but it might not be, hence "warning" instead of "deprecation". So although we could switch this to a FeatureDeprecated, that is not being done at this time.
2021-11-20Update expected skip condition for llvm framework test on msys2Jon Turney1-1/+1
On msys2, we will now find static llvm using cmake
2021-11-18tests: remove extraframework test for pythonDylan Baker1-3/+0
This tries to link the system provided python, which is deprecated and will result in an ambiguous error like "your binary is not an allowed client of .../Library/Frameworks/python.framework/python.tbd for architecture x86_64".
2021-11-15Merge pull request #9520 from dcbaker/submit/gnome-first-typed-kwargsJussi Pakkanen2-2/+0
Add typed_kwargs to some of the gnome module functions
2021-11-15Merge pull request #9565 from bonzini/invalid-run-targetJussi Pakkanen6-0/+41
reject run_target in test or install script arguments
2021-11-15dependencies/zlib: Add system zlib method for androidDudemanguy1-2/+2
The same method that the BSDs use should also work for android. Also update the tests and docs where appropriate.
2021-11-15interpreter: disallow RunTarget in meson.add_install_scriptPaolo Bonzini3-0/+23
Without this patch, the name of the RunTarget is passed to the install script; for the enclosed test, meson setup (incorrectly) succeeds, but installation fails.
2021-11-15interpreter: disallow RunTarget in testPaolo Bonzini3-0/+18
Fixes the following error in the testcase: File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 548, in generate self.generate_tests() File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 1093, in generate_tests self.serialize_tests() File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 567, in serialize_tests self.write_test_file(datafile) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 943, in write_test_file self.write_test_serialisation(self.build.get_tests(), datafile) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1017, in write_test_serialisation pickle.dump(self.create_test_serialisation(tests), datafile) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1002, in create_test_serialisation cmd_args.append(self.construct_target_rel_path(a, t.workdir)) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1021, in construct_target_rel_path return self.get_target_filename(a) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 253, in get_target_filename assert(isinstance(t, build.BuildTarget))
2021-11-08tests/vala: remove useless keyword argumentDylan Baker2-2/+0
The `packages` argument to `gnome.generate_gir` was allowed, but never did anything, so stop passing it.
2021-11-04fix regression that broke string.format with list objectsEli Schwartz1-0/+1
String formatting should validly assume that printing a list means printing the list itself. Instead, something like this broke: 'one is: @0@ and two is: @1@'.format(['foo', 'bar'], ['baz']) which would evaluate as: 'one is: foo and two is: bar' or: 'the value of array option foobar is: @0@'.format(get_option('foobar')) which should evaluate with '-Dfoobar=[]' as 'the value of array option foobar is: []' But instead produced: meson.build:7:0: ERROR: Format placeholder @0@ out of range. Fixes #9530
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-31Fix cygwin test failure due to shortpath usageNirbheek Chauhan1-0/+5
Two tests are failing on Cygwin because the argument is passed as a long-path and the Path is ending up as a short-path: AllPlatformTests.test_run_target_files_path Traceback (most recent call last): File "/cygdrive/d/a/meson/meson/test cases/common/51 run target/check-env.py", line 22, in <module> assert build_root == env_build_root AssertionError SubprojectsCommandTests.test_purge > self.assertEqual(deleting(out), sorted([ str(self.subprojects_dir / 'redirect.wrap'), str(self.subprojects_dir / 'sub_file'), str(self.subprojects_dir / 'sub_git'), ])) E AssertionError: Lists differ: ['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49[205 chars]git'] != ['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/s[196 chars]git'] [...] ['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap', ^^^^^^^^^^^ ['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap', ^^^^^^^^ The fix is to not use the tempdir for all tests, but only for tests that check the mode.
2021-10-30Added warning if run_command is called without the check kwargVolker Weißmann24-50/+50
2021-10-27modules/gnome: ensure that `install_dir` is setDylan Baker1-3/+3
The `mkenums` functions can have this unset if, and only if, the c file only variant is called. Due to side effects if the header file is generated then `install_dir` is ensured to be set for the c file. I have removed this side effect so that our tests actually cover this case. Fixes #9472
2021-10-27Fix add_install_script() ignoring install_tagXavier Claessens1-0/+3
Fixes: #9454
2021-10-27Fix crash when getting cuda optionsXavier Claessens3-2/+12
We could have an OptionOverrideProxy of an OptionOverrideProxy, recursively. This fix is a minimal subset of the refactoring I did in https://github.com/mesonbuild/meson/pull/9394. Instead of faking UserOption we can just do a shallow copy of one and set a new value on it. Fixes: #9448
2021-10-26interpreter: Revert old path joining behavior (fixes #9450)Daniel Mensinger1-0/+3
2021-10-24interpreter: Fix missing featuer check (fixes #9425)Daniel Mensinger2-0/+14
2021-10-12interpreter: Fix missing holder entry (fixes #9389)Daniel Mensinger1-0/+11
2021-10-10Fix typos discovered by codespellChristian Clauss11-11/+11
2021-10-10Revert "interpreter: Add FeatureNew check"Eli Schwartz2-8/+1
This reverts commit c0efa7ab22f8900f6fa1dadf0d306ec375569c8d. This was a nice idea, or a beautiful hack depending on your perspective. Unfortunately, it turns out to be a lot harder than we originally thought. By operating on bare nodes, we end up triggering a FeatureNew on anything that isn't a string literal, rather than anything that isn't a string. Since no one else has come up with a better idea for implementing a FeatureNew, let's just revert it. Better to not have a warning, than have it trigger way too often.
2021-10-10Be more strict about target names with slashes.Jussi Pakkanen1-1/+1
2021-10-09optinterpreter: Add deprecated kwargXavier Claessens3-0/+59
It can be either: - boolean: the option is completely deprecated. - list: some choices are deprecated. - dict: some choices are deprecated and replaced by another. Fixes: #7444
2021-10-09optinterpreter: Refactor to use typed_pos_args() and typed_kwargs()Xavier Claessens1-1/+1
2021-10-08python: Add platlibdir and purelibdir optionsXavier Claessens3-0/+16
2021-10-08add install_emptydir functionEli Schwartz2-0/+11
This replaces the absolute hack of using ``` install_subdir('nonexisting', install_dir: 'share') ``` which requires you to make sure you don't accidentally or deliberately have a completely different directory with the same name in your source tree that is full of files you don't want installed. It also avoids splitting the name in two and listing them in the wrong order. You can also set the install mode of each directory component by listing them one at a time in order, and in fact create nested structures at all. Fixes #1604 Properly fixes #2904
2021-10-06interpreter: Holderify arrays and dictsDaniel Mensinger4-4/+4
This is the final refactoring for extracting the bultin object logic out of Interpreterbase. I decided to do both arrays and dicts in one go since splitting it would have been a lot more confusing.
2021-10-06cmake: Implement support for interpreting link "keywords"Daniel Mensinger2-1/+5
CMakes `target_link_libraries()` supports certain keywords to only enable specific libraries for specific CMake configurations. We now try our best to replicate this for Meson dependencies. Fixes #9197
2021-10-06cmake: Warn if we could use IMPORTED CMake targetsDaniel Mensinger2-1/+11
2021-10-04backend/vs: Generate dependencies for CustomTargetIndex for a CustomTarget.Andres Freund6-0/+76
Test & fix.
2021-10-04backend/vs: process link dependencies.Andres Freund3-15/+0
Partially-Fixes: #1799
2021-10-04various python neatness cleanupsEli Schwartz2-3/+3
All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles.
2021-10-01rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker3-0/+32
Otherwise changes to a dependency don't propogate