aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2022-10-24Add NASM compilerXavier Claessens2-0/+46
2022-10-23Merge pull request #10916 from xclaesse/preprocessJussi Pakkanen6-0/+27
Add cc.preprocess() method
2022-10-23gnulike: Fix preprocessing files with any extensionXavier Claessens1-1/+0
2022-10-23Add unit test for cc.preprocess()Xavier Claessens6-0/+28
2022-10-23Fix excluding sources for static lib in both_libraries()Xavier Claessens2-0/+23
When using both_libraries(), or library() with default_library=both, we remove all sources from args and kwargs when building the static library, and replace them by the objects from the shared library. But sources could also come from any InternalDependency, in which case we currently build them twice (not efficient) and link both objects into the static library. It also means that when we needlessly build those source for the static library, it miss order dependency on generated headers that we removed from args/kwargs, which can cause build errors in the case the source from static lib is compiled before the header in shared lib gets generated. This happened in GLib: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2917.
2022-10-09compilers: Add optimization=plain optionJan Tojnar1-1/+1
https://github.com/mesonbuild/meson/pull/9287 changed the `optimization=0` to pass `-O0` to the compiler. This change is reasonable by itself but unfortunately, it breaks `buildtype=plain`, which promises that ā€œno extra build flags are usedā€. `buildtype=plain` is important for distros like NixOS, which manage compiler flags for optimization and hardening themselves. Let’s introduce a new optimization level that does nothing and set it as the default for `buildtype=plain`.
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.