aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2022-03-11test cases: rename shared library('c') avoid libc collisionEli Schwartz5-5/+10
In a bunch of cases we create a series of sample libraries named "a", "b", "c" etc. This breaks on musl. Originally reported with muon via commit https://git.sr.ht/~lattis/muon/commit/ca5c37171423e9884047a85349e1b236d7449510 and also breaks the testsuite when packaging meson for alpine linux. libc.so is an existing library which is linked in by default for all the obvious reasons. You can get away with this on glibc, because that includes a soversion of "6", but it loads the wrong library on musl.
2022-03-11tests: do not use a GNU bash script to check the minimum version of programsEli Schwartz2-10/+1
find_program() can check that for us already, there's no need to require GNU bash on systems that default to other POSIX shells. Even though this is the *linuxlike* tests and a POSIX shell is guaranteed, there is actually no need to require a shell at all. It's *easier* to use the meson builtin functionality here.
2022-02-14ninjabackend: fix rust program names with dashesAlyssa Ross3-6/+6
This substitution matches the behaviour of rustc[1] when inferring crate name based on file name. [1]: https://github.com/rust-lang/rust/tree/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/compiler/rustc_session/src/output.rs#L88
2022-02-14dlang: add test case for root include_directory #9250Tobias Pankrath4-0/+23
2022-02-14ninjabackend: treat link_whole_targets like link_targets for Rust targetsZach Reizner5-0/+27
For static library crates that depend on other internal static library crates, all link_with targets get promoted to link_whole targets. Due to a bug, only link_with targets are considered when generating a Rust target for the ninja backend. This made it impossible to link a Rust static library with another internal Rust static library. This change fixes that issue by chaining link_whole_targets with link_targets, just like many other languages within the ninja backend.
2022-02-14Add test for empty string default_valueNirbheek Chauhan2-0/+10
Backported from 0185f2ed61290715f990f786597f3b73a36e678f, which contains a fix that doesn't need to be backported, but we can backport the test to ensure that it's still working in the 0.61 branch.
2022-02-14add location data to various Feature checksEli Schwartz1-1/+1
2022-02-14modules/gnome: Allow gdbus_annotations to take an empty list againDylan Baker1-0/+10
This was allows up to 0.61.0 (including with the initial type annotations), but was accidentally broken by fixes for other bugs in 0.61.1. Fixes: #9883
2022-01-16gnome.genmarshal: restore the ability to pass sources as Files objectsEli Schwartz3-17/+61
It used to support: - a single string - an array of anything And as long as CustomTarget supported it too, everything worked fine. So, a `files('foo')` worked but a `files('foo')[0]` did not, which is silly... and it's not exactly terrible to use files() here, the input is literally a list of source files. Fixes building gnome-terminal Fixes #9827 Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
2022-01-16Fix system include arguments for clang-clGatgat3-0/+20
2022-01-15tests: Add a partial test for gtk_doc check: kwargNirbheek Chauhan1-1/+2
check: true is needed for an actual regression test, but that requires a pedantically correct gtk-doc configuration, which I attempted to do and failed. So let's just put check: false so we get *some* coverage: just that typed_kwargs accepts the argument. Related to https://github.com/mesonbuild/meson/pull/9807
2022-01-15tests: Add regression tests for gdbus_codegen argsNirbheek Chauhan2-1/+22
https://github.com/mesonbuild/meson/pull/9812
2022-01-15tests: Add a regression test for gtk-doc argumentsNirbheek Chauhan5-0/+14
gobject_typesfile html_assets https://github.com/mesonbuild/meson/pull/9807
2022-01-15tests: Add a regression test for vapigen metadatadirNirbheek Chauhan2-0/+8
https://github.com/mesonbuild/meson/pull/9806
2022-01-07Fix typo.Itoh Shimon1-1/+1
2022-01-02Condense test directory numbers for rc1.Jussi Pakkanen77-11/+11
2022-01-02test cases/frameworks/13 yelp: Do not reuse sources filesPablo Correa Gómez4-8/+24
Additionally reorder test.json for better readability
2021-12-22unit tests: Don't check quoting with multiple libsNirbheek Chauhan1-0/+1
pkgconf has a bug on MSYS2 due to which prefixes with spaces are not handled correctly if the library has a Requires: on another library and both have prefixes with spaces in them. See: https://github.com/pkgconf/pkgconf/issues/238 So move the unit test to libanswer.pc instead of libfoo.pc till that is fixed.
2021-12-22Set RPATH for all non-system libs with absolute pathsNirbheek Chauhan4-3/+22
If a pkg-config dependency has multiple libraries in it, which is the most common case when it has a Requires: directive, or when it has multiple -l args in Libs: (rare), then we don't add -Wl,-rpath directives to it when linking. The existing test wasn't catching it because it was linking to a pkgconfig file with a single library in it. Update the test to demonstrate this. This function was originally added for shared libraries in the source directory, which explains the name: https://github.com/mesonbuild/meson/pull/2397 However, since now it is also used for linking to *all* non-system shared libraries that we link to with absolute paths: https://github.com/mesonbuild/meson/pull/3092 But that PR is incomplete / wrong, because only adding RPATHs for dependencies that specify a single library, which is simply inconsistent. Things will work for some dependencies and not work for others, with no logical reason for it. We should add RPATHs for *all* libraries. There are no special length limits for RPATHs that I can find. For ELF, DT_RPATH or DT_RUNPATH are used, which are just stored in a string table (DT_STRTAB). The maximum length is only a problem when editing pre-existing tags. For Mach-O, each RPATH is stored in a separate LC_RPATH entry so there are no length issues there either. Fixes https://github.com/mesonbuild/meson/issues/9543 Fixes https://github.com/mesonbuild/meson/issues/4372
2021-12-22pkgconfig: Fix linking to a custom targetXavier Claessens2-0/+17
When generating pkgconfig file for a library that links to an uninstalled static library built by custom_target() Meson was crashing when trying to access some attributes that does not exist on that class. Also fix is_internal() implementation, it only really make sense on a CustomTargetIndex or if CustomTarget has only a single output.
2021-12-20restore additional info about the potential cause of find_program failingEli Schwartz1-1/+1
Before commit f08eed37cb69ba0d793c0f1d086eaef7f25c2ea3 we also mentioned that it might not be executable.
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.