aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
AgeCommit message (Collapse)AuthorFilesLines
2021-03-14Fix run_targets running scripts from different subdirs.Jussi Pakkanen1-0/+9
2021-03-12Fix duplicate pkg_config_path entriesTristan Partin1-0/+12
Previously builds would *potentially* get sammed with messaging at configure time that duplicate entries in an array would be an error in the future, and the cause was because the same entries were getting added over and over to pkg_config_path.p
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-105/+105
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz1-31/+31
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-03-04raw string literals are next to godlinessEli Schwartz1-1/+1
Invalid escape sequences are deprecated and will be removed from a future version of python. Use r"" to define them so they remain readable.
2021-03-04mintro: include the correct target filenames for flat layoutPaolo Bonzini1-0/+13
Fixes: #8408
2021-03-02mtest: create separate runners for multiple repeatsPaolo Bonzini1-0/+6
Reusing the runners for multiple repeats of the test run gets in the way of the progress report, which stores runners in an OrderedSet. Instead, create a separate SingleTestRunner object for each repeat. While at it, fix the "duplicate suite" assertion as it can fire with TAP tests and --repeat=N. Fixes: #8405
2021-02-26interpreter: correctly track whether a subproject is initializedDylan Baker1-0/+7
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 Gregoratto1-0/+1
2021-02-25Support multiple args in error()Xavier Claessens1-0/+5
Seems it got forgotten when that was added to warnings() and message(). Fixes: #8414.
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens1-0/+47
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-18allow build.b_* optionsDylan Baker1-0/+5
These continue to be ignored as they always have, but no longer raise an error. Fixes: #8354
2021-02-18Disable failing Cygwin GIR test.Jussi Pakkanen1-0/+2
2021-02-17ci: Fix failure in unit tests with vs backendXavier Claessens1-1/+1
2021-02-17unittests: expect mtest logs to be utf-8Paolo Bonzini1-7/+7
2021-02-17compilers: Only insert -flto-jobs in clang's link argumentsDylan Baker1-5/+9
Clang has a hand `-Wunused-command-line-argument` switch, which when turned to an error, gets very grump about `-flto-jobs=0` being set in the compiler arguments (although `-flto=` belongs there). We'll refactor a bit to put that only in the link arguments. GCC doesn't have this probably because, a) it doesn't have an equivalent warning, and b) it uses `-flto=<$numthreads. Fixes: #8347
2021-02-17Substitute @CURRENT_SOURCE_DIR@ in run_target() and custom_target()Xavier Claessens1-0/+1
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 Baker1-0/+8
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-16Small patch to unittests to initialize CUDA compiler correctly.Olexa Bilaniuk1-1/+1
Suggested by Dylan Baker.
2021-02-09mtest: TestSetup can have [] as an exe_wrapperPaolo Bonzini1-0/+2
Fix "meson test --wrapper foo --setup bar", it should work just fine if the setup does not define a wrapper. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-09Condense test directory names in preparation for rc1.Jussi Pakkanen1-3/+3
2021-02-08Fix exe wrapper detection for run targets.Jussi Pakkanen1-2/+1
2021-02-07Add Qt6 moduleLuca Weiss1-0/+20
2021-02-07Make installing non-existing subdirs a supported featurePeter Hutterer1-0/+1
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-0/+10
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen1-0/+1
run_target: Add env kwarg
2021-02-06interpreterbase: Add support for optional arguments to typed_pos_argsDylan Baker1-0/+60
This allows representing functions like assert(), which take optional positional arguments, which are not variadic. More importnatly you can represent a function like (* means optional, but possitional): ```txt func(str, *int, *str) ``` typed_pos_args will check that all of your types are correct, and if not provide None, which allow simplifying a number of implementation details
2021-02-06interpreterbase: Add support for variadic arguments to typed_pos_argsDylan Baker1-0/+96
This allows functions like `files()` to be decorated.
2021-02-06interpreterbase: Add a helper method for typing positional argumentsDylan Baker1-0/+34
We don't do a very good job of type checking in the interpreter, sometimes we leave it to the mid layers of backends to do that (layering violations) and sometimes we just don't check them at all. When we do check them it's a ton of boilerplate and complicates the code. This should help quite a bit.
2021-02-05run_unittests: fix misc lint errors due to whitespace or unused imports/argsEli Schwartz1-5/+3
2021-02-05run_unittests: fix undefined variable in error messageEli Schwartz1-1/+1
In commit fe973d9fc45581f20fefc41fc0b8eb0066c0129d, some uses of p got rewritten to compiler.language, but not all. We'd still raise an error message, but for the wrong thing. o_O
2021-02-05run_unittests: remove double definition of the same test caseEli Schwartz1-16/+0
In commit 591e6e94b9fccfc49ee7093cb21735a27fd64005 we somehow ended up with an identical extra copy.
2021-02-05unittests: fix error message stringDylan Baker1-3/+13
2021-02-05run_target: Add env kwargXavier Claessens1-0/+1
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-04minstall: Add --dry-run optionXavier Claessens1-5/+14
Closes: #1281
2021-02-02Add support for LLVM's thinLTODylan Baker1-0/+25
This uses a separate option, b_lto_mode. It works in conjunction with b_lto_threads. Fixes #7493
2021-02-02compilers: Add support for using multiple threads with ltoDylan Baker1-0/+21
Both Clang and GCC support using multiple threads for preforming link time optimizaions, and they can now be configured using the `-Db_lto_threads` option. Fixes #7820
2021-02-02interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini1-0/+10
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-01-30Merge pull request #8200 from bonzini/mtest-asyncio-logsJussi Pakkanen1-0/+1
mtest: improvements to logging
2021-01-29Can read project version from a file.Jussi Pakkanen1-0/+6
2021-01-26dist: Allow packaging subproject in same git repo as main projectXavier Claessens1-16/+44
2021-01-22unittests: use utf-8 encoding for child processesPaolo Bonzini1-0/+1
Ensure that unit tests will be able to parse UTF-8 output of "meson test".
2021-01-21interpreter: accept external programs and dependencies for summaryPaolo Bonzini1-0/+6
2021-01-20unittests: Remove double install for case 10Fini Jastrow1-5/+2
[why] In test case 10 the project is installed twice. This has been introduced with commit 55abe16 unit tests: Test that relative install_rpath works correctly where the cxx tests where added by copy and paste. [how] First test all build rpaths, then after install all install rpaths. [note] The aforementioned commit is a bit strange in that it adds a tests with a relative rpath with cxx files but not with c files. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2021-01-20ninjabackend: Correct RPATH orderFini Jastrow1-0/+22
[why] If we build and test a library we need to make sure that we find the currently build library object first, before an older system installed one. This can be broken if the library in question is installed in a custom path, and another library we depend on also is installed there. [how] Just move the rpath to the current build artifacts to the front. Solves #8030. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2021-01-19Keep buildtype the same even if user changes debug and/or optimization.Jussi Pakkanen1-41/+3
2021-01-18Fix cases where text leaks to stdout in unit tests.Jussi Pakkanen1-2/+2
2021-01-14coredata: Add missing nopromote wrap_mode choiceXavier Claessens1-0/+6
2021-01-13Fix misspellsAntonin Décimo1-2/+2
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-12summary: align left, not align middleEli Schwartz1-12/+12
aligning along the left is, I think, what most projects want to do. Aligning along the middle looks subjectively ugly, and objectively prevents me from further indenting an element, e.g. Build information: prefix : /usr sysconfdir : /etc conf file : /etc/myprogram.conf