aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2021-03-10Disable broken asm test on Cygwin as nobody knows how to fix it.Jussi Pakkanen1-0/+4
2021-03-09Add str.replace() methodTristan Partin1-1/+5
2021-03-06Refactor subdir visitation to track files instead of dirs.Jussi Pakkanen3-0/+11
2021-03-06Fix Fortran dep scanner for upper case file extensions. Closes #8395.Jussi Pakkanen2-1/+2
2021-03-04use python2-compatible syntax because needed on macOSEli Schwartz1-2/+2
Apparently this unittest runs on macOS using the system python2.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz14-22/+22
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz12-12/+7
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-27install_man locale supportJason Woodward3-0/+3
Rather than having to manually build the locale aware man paths with `install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')` Support doing `install_man('foo.fr.1', locale: 'fr')`
2021-02-26Merge pull request #8429 from dcbaker/submit/rust-fix-linking-with-find-libraryDylan Baker5-0/+53
rust: correctly handle -l link args
2021-02-26interpreter: Clean up and simplify/optimize get_(external|cross)_propertyDylan Baker6-8/+18
These are both way more compilcated than they needed to be, this is a much simpler implementation, and is shared between cross and external properies.
2021-02-26tests/rust: Add rust case linking to libm in rust static libraryJordan Justen5-0/+53
When building on Linux, I see: rustc -C linker=cc --color=always --crate-type rlib --crate-name rs_math -g --emit dep-info=rs_math.d --emit link -L /usr/lib/x86_64-linux-gnu -o librs_math.rlib -l static=m ../rs_math.rs error: failed to add native library /usr/lib/x86_64-linux-gnu/libm.a: file too small to be an archive I think the "file too small to be an archive" message is coming from libLLVM, and is a case of LLVM not handling this type of "script archive". So, possibly this is just LLVM not handling a linking case. The rust_args usage in meson.build is invalid, but required to reproduce the issue in the test case. Perhaps meson should automatically add the library include path via the dep_m meson object, or maybe the meson.build can add the link path in a better way. Changing '-l static=m' to '-l dylib=m' appears to fix this case. (See comments in meson.build.)
2021-02-26interpreter: correctly track whether a subproject is initializedDylan Baker4-0/+23
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
2021-02-26Allow printing UserOptions in the summaryStephen Gregoratto2-0/+2
2021-02-26meson: add .has_external_property() methodsTim-Philipp Müller2-2/+27
Useful in case of boolean values to distinguish between a boolean value having been set in the native/cross file and not having been provided, which can't be achieved by passing a fallback parameter to .get_external_property().
2021-02-26Merge pull request #8404 from dcbaker/submit/rust-c-dependenciesJussi Pakkanen5-0/+62
Fix linking Rust with C dependencies
2021-02-25Allow custom target output to be processed by generatorsMatthias Klumpp3-4/+22
2021-02-23rust: fix linking with external dependenciesDylan Baker1-1/+4
Rust can link with any dependency that uses c linkage, which is pretty much what we assume across the board anyway.
2021-02-23tests/rust: Add rust case linking to zlib dependencyJordan Justen5-0/+59
Reworks: * Add MESON_SKIP_TEST error for darwin from polyglot test * Remove dependencies from executable Dylan's changes: * Add support for both static and shared testing * Test with pkg-config, cmake, and system * reformat to meson's style Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2021-02-22[CUDA] Bugfix: Forward sanitizer_*_args() methods to host compiler.Olexa Bilaniuk2-0/+34
Enables -Db_sanitize=undefined and company. Also serves as a testcase for NVCC comma-shielding: Because the test- case declares `b_sanitize=address,undefined`, the host GCC compiler needs `-fsanitize=address,undefined`, but this stands a danger of being split by NVCC when wrapped with `-Xcompiler=args,args`. Special, already-existing comma-shielding codepaths activate to prevent this splitting. Closes #8394.
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens10-0/+27
By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
2021-02-19Fix combining C and Fortran. Closes #8377.Jussi Pakkanen2-2/+18
2021-02-19[TAP] Fix TAP parser when test exits with statusLuke Drummond2-1/+11
Some time between 0.56 and 0.57 the TAP parser broke when a test exits with a nonzero status. The TAP protocol does not specify this behaviour - giving latitude to implementers, and meson's previous behaviour was to report the exit status gracefully. This patch restores the old behaviour and adds a regression test
2021-02-19Ensure that $lang_args and $lang_link_args are properly parsedDylan Baker3-0/+29
Currently we don't handle things correctly if we get a string we should split, and the linker and needs compiler arguments. It would result in two unsplit strings in a list, instead of the split arguments in a list Fixes: #8348
2021-02-18Increase OpenMPI timeout to see if it fixes macOS CI test hangs.Jussi Pakkanen1-3/+3
2021-02-18Disable failing Cygwin GIR test.Jussi Pakkanen5-0/+20
2021-02-17ci: Fix failure in unit tests with vs backendXavier Claessens1-2/+2
2021-02-17Do not validate options when finding non-matchingDylan Baker3-0/+20
This is a) useless because it's only used to print which options are not default, and b) harmful because it can result in cases where things break, like in projects that set a standard that the chosen compiler doesn't support, but the project (or some subset) can be built with a different standard. Fixes: #8360
2021-02-17Substitute @CURRENT_SOURCE_DIR@ in run_target() and custom_target()Xavier Claessens2-3/+34
run_target() does some variable substitutions since 0.57.0. This is a new behavior, and undocumented, caused by sharing more code with custom_target(). More consistency is better, so document it now. custom_target() was doing variable substitution in the past, because it shared some code with generator(), but that was undocumented. Some refactoring in 0.57.0 caused it to not replace @CURRENT_SOURCE_DIR@, @SOURCE_DIR@, and @BUILD_DIR@ anymore. This patch adds back @CURRENT_SOURCE_DIR@ and document it. It does not add back @SOURCE_DIR@ because it is duplicate with @SOURCE_ROOT@ that has a better name. Also do not add back @BUILD_DIR@ which is duplicate of @PRIVATE_DIR@, and not @BUILD_ROOT@ surprisingly, adding to the confusion.
2021-02-17Environment: Fix passing envrionment variables CPPFLAGS and CFLAGSDylan Baker3-0/+40
Or other language flags that use CPPFLAGS (like CXXFLAGS). The problem here is actually rather simple, `dict.setdefault()` doesn't work like I thought it did, I thought it created a weak entry, but it actually is equivalent to: ```python if k not in dict: dict[k] = v ``` Instead we'll use an intermediate dictionary (a default dictionary actually, since that makes things a little cleaner) and then add the keys from that dict to self.options as applicable. Test case written by Jussi, Fix by Dylan Co-authored-by: Jussi Pakkanen Fixes: #8361 Fixes: #8345
2021-02-09backends: Fix custom_target() with configure_file() exeXavier Claessens1-1/+4
2021-02-09Condense test directory names in preparation for rc1.Jussi Pakkanen21-0/+0
2021-02-08Fix exe wrapper detection for run targets.Jussi Pakkanen1-2/+7
2021-02-07Add Qt6 moduleLuca Weiss1-1/+4
2021-02-07Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen8-0/+191
Add a wrapper to the rust module for bindgen
2021-02-07Make installing non-existing subdirs a supported featurePeter Hutterer2-1/+5
install_subdir() with a non-existing subdir creates the directory in the target directory. This seems like an implementation detail but is quite useful to create new directories for e.g. configuration or plugins in the installed locations. git bisect says this started with 8fe816101467e66792251b4f57e0ddddb537764a. Let's add a test for it and document it to make this behavior official. Limitation: it can only create at the install_dir location, trying to create nested subdirectories does not work and indeed creates the wrong directory structure. That is a bug that should be fixed separately: install_subdir('blah', install_dir: get_option('prefix')) install_subdir('sub/foobar', install_dir: get_option('prefix')) install_subdir('foo/baz', install_dir: get_option('prefix')) $ tree ../_inst ../_inst ├── baz ├── blah └── foobar Fixes #2904
2021-02-07Merge pull request #8288 from bonzini/test-setup-exclude-suitesJussi Pakkanen1-1/+2
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen2-0/+15
run_target: Add env kwarg
2021-02-06rust: Add a module wrapper for bindgenDylan Baker8-0/+191
This has a couple of advantages over rolling it by hand: 1. it correctly handles include_directories objects, which is always handy 2. it correctly generates a depfile for you, which makes it more reliable 3. it requires less typing
2021-02-05tests/cmake: disable some tests that don't work correctly when cross compilingDylan Baker3-0/+12
2021-02-05run_target: Add env kwargXavier Claessens2-0/+15
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-02-04Introduce `fs.read` to read a file as a stringLuke Drummond5-0/+26
Following #7890, this patch introduces the ability to read the contents of a file to the fs module. This patch introduces the ability to read files at configure time, but has some restrictions: - binary files are not supported (I don't think this will prove a problem, and if people are wanting to do something with binary files, they should probably be shelling out to their own script). - Only files outside the build directory allowed. This limitation should prevent build loops. Given that reading an arbitrary file at configure time can affect the configuration in almost arbitrary ways, meson should force a reconfigure when the given file changes. This is non-configurable, but this can easily be changed with a future keyword argument.
2021-02-02interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini1-1/+2
This new keyword argument makes it possible to run specific test setups only on a subset of the tests. For example, to mark some tests as slow and avoid running them by default: add_test_setup('quick', exclude_suites: ['slow'], is_default: true) add_test_setup('slow') It will then be possible to run the slow tests with either `meson test --setup slow` or `meson test --suite slow`.
2021-02-01tests/common: fix " 37 has function" test on musl systems.Érico Rolim1-12/+21
This commit fixes the test that asserts on whether the lchmod() function should have been detected as available by Meson. It does so by assuming that on Linux systems not using glibc, the function will be available. - fix comment about lchmod on Linux: musl has implemented the function correctly since 2013, so the assumption in the test wasn't correct. Furthermore, musl doesn't use glibc's stub mechanism. - fix include to receive __GLIBC__ definition: including almost any header in glibc will end up defining __GLIBC__, since most headers include <features.h>. The <gnu/libc-version.h> header was probably chosen because of its name, but its actual purpose is defining functions for checking glibc version at runtime (instead of what the binary was built with), so it isn't necessary to use it. Since it is a completely non standard header, including it makes the test suite fail on musl due to not finding the header.
2021-01-30Fix executable as script on WindowsXavier Claessens4-2/+32
On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
2021-01-29Can read project version from a file.Jussi Pakkanen2-1/+2
2021-01-27intepreter: Allow using file objects for the script_name of add_*_scriptDylan Baker3-0/+9
It's a bit silly and conveluted to have to call find_program on the output of configure_file, so let's just allow passing files as the script name.
2021-01-27custom_target: Add env kwargXavier Claessens2-0/+2
2021-01-25Merge pull request #8236 from ↵Jussi Pakkanen4-3/+30
dcbaker/submit/rust-fix-generated-sources-in-subdir Submit/rust fix generated sources in subdir
2021-01-23Merge pull request #8226 from jonaslb/fortranstaticJussi Pakkanen6-0/+74
Fixes for fortran: Include dirs for link_whole_targets and capital file suffix
2021-01-21tests/rust: Add a generated library to generated main testDylan Baker4-1/+19
Which is broken, of course.