aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2022-09-28wrap: If the directory exists in a sub-subproject, uses it inplaceXavier Claessens4-0/+9
A subproject could have a sub-subproject as a git submodule, or part of the subproject's release tarball, and still have a wrap file for it (e.g. needed for [provide] section). In that case we need to use the source tree for the sub-subproject inplace instead of downloading a new copy into the main project. This is the case with GLib 2.74, it has a subproject "gvdb" as git submodule, and part of release tarball, it ships gvdb.wrap file as well.
2022-09-19python module: allow specifying the pure kwarg in the installation objectEli Schwartz2-1/+15
Fixes #10523
2022-09-12dependencies: log the real reason for a dependency lookup failingEli Schwartz3-3/+3
In the debug logs, always log if a dependency lookup raises a DependencyException. In the `required: false` case, this information would otherwise disappear forever, and we would just not even log that we tried it -- it doesn't appear in "(tried x, y and z)". In the `required: true` case, we would re-raise the first exception if it failed to be detected. Update the raise message with the same information we print to the debug logs, indicating which dependency and which method was used in the failing attempt.
2022-09-09tests: Add a test for a target with no sourcesDylan Baker2-0/+10
Since this was broken for a long time, we should have a test for it.
2022-09-07modules/wayland: Rename core_only to include_core_onlyMark Bolhuis1-1/+1
Rename the core_only option in scan_xml to include_core_only to match the flag used by wayland-scanner.
2022-09-06modules/wayland: Support --include-core-onlyMark Bolhuis2-0/+23
wayland-scanner can generate header files that only include wayland-client-core.h using a flag. Add a core_only option to scan_xml to support this use case.
2022-09-04Add missing cdata update in genmarshal testsJan Alexander Steffens (heftig)1-0/+3
Otherwise the test is flaky, as it may try to include a header that's not generated yet.
2022-09-03tests/7 gnome: Fix incorrect unref of GResourceNirbheek Chauhan2-4/+3
The returned GResource is transfer-none, since the generated function basically calls g_static_resource_get_resource(). It should not be unreffed. Causes an abort on Debian: GLib-GIO:ERROR:../../../gio/gresource.c:1451:g_static_resource_fini: assertion failed: (g_atomic_int_get (&resource->ref_count) >= 2)
2022-08-23install modes should not apply sticky bit to filesEli Schwartz1-1/+8
This is generally a bad idea, e.g. it causes OSError on freebsd. It also gets ignored by solaris and thus causes unittest failures. The proper solution is to simply reject any attempt to set this, and log a warning. The install_emptydir function does apply the mode as well, and since it is a directory it actually does something. This is the only place where we don't reset the mode. Although install_subdir also installs directories, and in theory it could set the mode as well, that would be a new feature. Also it doesn't provide much granularity and has mixed semantics with files. Better to let people use install_emptydir + install_subdir. Fixes #5902
2022-08-23tests: remove compiler requirement in various unneeded casesEli Schwartz107-107/+108
Compiled languages are Meson's bread and butter, but hardly required. This is convenient, because many test caases specifically, do not care about testing the compiler interactions. In such cases, we can skip doing compiler lookups which aren't used, as they only slow down test setup.
2022-08-23pkgconfig: Variables can be a single stringXavier Claessens2-0/+8
It used to be listified and libxml2 wrap relies on that.
2022-08-18modules/pkgconfig: Use typed_kwargsDylan Baker3-3/+3
2022-08-18modules/fs: Replace configure_file(copy:) with fs.copyfileDylan Baker1-1/+21
`configure_file` is both an extremely complicated implementation, and a strange place for copying. It's a bit of a historical artifact, since the fs module didn't yet exist. It makes more sense to move this to the fs module and deprecate this `configure_file` version. This new version works at build time rather than configure time, which has the disadvantage it can't be passed to `run_command`, but with the advantage that changes to the input don't require a full reconfigure.
2022-08-18minstall: do not trample install_mode by rpath fixerEli Schwartz1-0/+1
install_mode can include the setuid bit, which has the special property (mentioned in the set_mode logic for minstall itself) of needing to come last, because it "will get wiped by chmod" (or at least chown). In fact, it's not just chown that wipes setuid, but other changes as well, such as the file contents. This is not an issue for install_data / custom_target, but for compiled outputs, we run depfixer to handle rpaths. This may or may not cause edits to the binary, depending on whether we have a build rpath to wipe, or an install rpath to add. (We also may run `strip`, but that external program already has its own mode restoration logic.) Fix this by switching the order of operations around, so that setting the permissions happens last. Fixes https://github.com/void-linux/void-packages/issues/38682
2022-08-17tests/common/215: Save some time by only checking pkg-configDylan Baker1-1/+1
2022-08-17tests: fix targets with no sourcesDylan Baker9-6/+10
This was never supposed to be possible, so stop doing it.
2022-08-17interpreter: deprecate the ability import unstable modules as `unstable_*`Dylan Baker2-0/+4
This was never meant to work, it's an implementation detail of using `importlib.import_module` and that our modules used to be named `unstable_` that this ever worked.
2022-08-17interpreter: move handling of module stability to interpreterDylan Baker6-2/+19
Thanks to `ModuleInfo`, all modules are just named `foo.py` instead of `unstable_foo.py`, which simplifies the import method a bit. This also allows for accurate FeatureNew/FeatureDeprecated use, as we know when the module was added and if/when it was stabilized.
2022-08-17modules: use module level information about new and deprecationDylan Baker2-0/+14
Instead of using FeatureNew/FeatureDeprecated in the module. The goal here is to be able to handle information about modules in a single place, instead of having to handle it separately. Each module simply defines some metadata, and then the interpreter handles the rest.
2022-08-17tests: remove deprecated `import('unstable_')`Dylan Baker2-2/+2
2022-08-11CI: fix error when mixing clang 14 with released valgrind versionsEli Schwartz1-0/+7
Because clang now defaults to a dwarf version that valgrind does not yet support. There's support in valgrind git master, though.
2022-08-11add compilers from extracted objects directly to build targetsEli Schwartz6-0/+42
In order to reliably link to static libraries or individual object files, we need to take their languages into account as well. For static libraries this is easy: we just add the static library's list of compilers to the build target. For extracted objects, we need to only add the ones for the objects we use. But we did this really inefficiently -- in fact, downright terribly. We iterated over all source files from the extracted objects, then tried to look up a new compiler for them. Even though the extracted objects already had a list of compilers! This broke once compilers were made per-subproject, because while the extracted objects have a reference to all the compilers it needs (just like static archives do, actually) we might not actually be able to look up that compiler from scratch inside the current subproject. Fix this by asking the extracted objects to categorize all its own sources and return the compilers we want. Fixes #10579
2022-08-10cmake: Add rule relaxations for CMake subprojectsDaniel Mensinger1-1/+1
fixes #10566
2022-08-07mtest: unify parsed and non-parsed output handlingHemmo Nieminen2-0/+22
Use the same routines to handle output both when parsing the output and when not. Also fixes broken stderr handling for parsed tests.
2022-07-31Only reconfigure if configure options actually changedDaan De Meyer2-0/+6
Currently, if we run "meson configure -Doption=value", meson will do a reconfigure when running "ninja build" afterwards, even if the new value is the same one that was already configured previously. To avoid this unnecessary reconfigure, let's use replace_if_different() instead of unconditionally replacing the conf file in coredata's save() function.
2022-07-25tests: Test extern'd globals on MacOS with the Apple ArchiverAilin Nemui5-0/+31
This forces the use of the Apple archiver, since that archiver doesn't add extern'd variables to the symbol table automatically, and instead requires that ranlib be used. A native file is used to ensure that Apple's ar is used even in the presence of llvm or gcc in the path with their superior archivers. Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-07-11tests: unskip windows mixing msvc and fortran, for non-gcc fortranEli Schwartz2-2/+4
These checked that e.g. the cpp and fc ids are identical, which isn't strictly what we want. Particularly, msvc doesn't even have a fortran compiler, and what we really care about is whether we mix both gcc and something else.
2022-07-08implement the new preserve_path kwarg for install_data tooEli Schwartz31-0/+69
Primarily interesting to me because it is then available for the python module's install_sources method. Based on the new feature in install_headers.
2022-07-07Fix test case numbers.Jussi Pakkanen121-5/+5
2022-07-06Improve error message for `include_directories(abs_path_intree)`Ralf Gommers1-1/+1
This error message was quite confusing when triggered by use of an absolute path to the include dir of an external dependency (numpy in my case). Changing that to a relative dir also isn't a solution, because Meson will *not* do the "busywork to make paths work" that the error message says it will.
2022-06-30test cases: Don't fall off the end of main() without an exit statusSimon McVittie3-0/+3
This is undefined behaviour, and seems to have caused test failures when backporting Meson to an older toolchain in the Steam Runtime. Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-21fix type checking for declare_dependency to allow linking to executableEli Schwartz1-0/+5
We have to handle this, because Windows needs to link to the implib of the executable (???) in order to create a shared module. This is explicitly checked for and handled in the backend, and creating a build target with `link_with: some_exe` still works, even. But updating declare_dependency to typed_kwargs neglected to take that into account, so creating a convenience interface for those same arguments failed.
2022-06-19Merge pull request #10464 from rtbo/fix_generated_depsJussi Pakkanen4-0/+41
add D generated files to order-only deps
2022-06-19python module: implicitly add python dep to extensionsEli Schwartz3-3/+0
If there isn't a preexisting dependency on python, append one. It's almost assuredly needed, so just do the right thing out of the box.
2022-06-19update gnome test to cover built gresource filesEli Schwartz3-4/+29
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2022-06-17external-project: Add depends kwargXavier Claessens1-0/+1
The unit test was racy but surprisingly never failed on CI. The reason is we need to ensure ninja build somelib.so before running `make` into the external project.
2022-06-17refactor logic for parsing dependency variables into type_checking moduleEli Schwartz3-3/+3
We will momentarily use this to implement typed_kwargs, but not for all usage sites.
2022-06-17docs: d_module_versions has an undocumented ability to accept integersEli Schwartz1-1/+1
Dlang uses both integer version "levels" and arbitrary string identifiers, and we support both, but don't mention it in the docs. Also update a test case to pass one via declare_dependency. We already test this kwarg for build_target.
2022-06-17interpreter: fix a subproject check with symlinksHemmo Nieminen5-3/+25
The check for whether or not a file is allowed to be accessed from a subproject fails if the subproject is accessed via a symlink. Use the absolute path of the subproject without resolving symlinks to fix the check. Extend unit test 106 to check for this in the future.
2022-06-16fix regression that broke proper warnings about passing subproject as a depEli Schwartz1-1/+1
Regression in commit 7c757dff71c031ae02ecc358a69a213a5db4051a. SubprojectHolder is no longer an ObjectHolder and says so via a TODO: this means that we have to fiddle with held_object. Yay.
2022-06-16test (failing): 127 subproject object as a dependencyfxxf4-0/+13
2022-06-14Fix crash when a reconfigure adds a new subprojectXavier Claessens4-0/+14
When a subproject is disabled on the initial configuration we should not add it into self.coredata.initialized_subprojects because that will prevent calling self.coredata.init_builtins() on a reconfigure if the subproject gets enabled. Fixes: #10225.
2022-06-14add testcase for previous commitPaolo Bonzini4-8/+68
2022-06-14take override_option('unity=...') into account when allowing extract_objects()Paolo Bonzini4-0/+17
A single target could be picked for unity build, and in that case extract_objects() should not be allowed. Likewise for the opposite case, where extract_objects() should be allowed if unity build is disabled for a single target. A test that covers that case is added later.
2022-06-09intro-install_plan: fix destinations for build_targets with custom install_dirEli Schwartz1-0/+4
There are a couple issues that combine to make the current handling a bit confusing. - we call it "install_dir_name" but it is only ever the class default - CustomTarget always has it set to None, and then we check if it is None then create a different variable with a safe fallback. The if is useless -- it cannot fail, but if it did we'd get an undefined variable error when we tried to use `dir_name` Remove the special handling for CustomTarget. Instead, just always accept None as a possible value of outdir_name when constructing install data, and, if it is None, fall back to {prefix}/outdir regardless of what type it used to be.
2022-06-07wrap: Add support for applying a list of patch filesPaweł Marczewski5-0/+96
Co-authored-by: Xavier Claessens <xavier.claessens@collabora.com>
2022-06-05add D generated files to order-only depsRemi Thebault4-0/+41
2022-06-01Fix sandbox violation when using subproject as a symlinkVili Väinölä4-0/+21
Fix "Tried to grab file outside current (sub)project" error when subproject exists within a source tree but it is used through a symlink. Using subprojects as symlinks is very useful feature when migrating an existing codebase to meson that all sources do not need to be immediately moved to subprojects folder.
2022-05-31fix regression that broke type checking of CustomTarget outputsEli Schwartz1-1/+1
We validate a few things here, such as the non-presence of '@INPUT' in an output name. These got moved out of the CustomTarget constructor in commit 11f96380351a88059ec55f1070fdebc1b1033117 and into KwargInfo, but only for kwargs that took multiple values. This caused configure_file() and unstable_rust.bindgen() to stop checking for this. Add a shared single-output KW and use it in both places. This now dispatches to _output_validator. configure_file now validates subdirectories in output names the same way we do elsewhere, directly in the typed_kwargs and by specifying the erroring kwarg.
2022-05-30Implement `preserve_path` for install_headersFlorian "sp1rit"​3-3/+9
The `install_headers` function now has an optional argument `preserve_path` that allows installing multi-directory headerfile structures that live alongside sourcecode with a single command. For example, the headerfile structure headers = [ 'one.h', 'two.h', 'alpha/one.h', 'alpha/two.h', 'alpha/three.h' 'beta/one.h' ] can now be passed to `install_headers(headers, subdir: 'mylib', preserve_path: true)` and the resulting directory tree will look like {prefix} └── include    └── mylib       ├── alpha       │   ├── one.h       │   ├── two.h       │   └── three.h       ├── beta       │   └── one.h       ├── one.h       └── two.h Fixes #3371