summaryrefslogtreecommitdiff
path: root/run_unittests.py
AgeCommit message (Collapse)Author
2021-02-17compilers: Only insert -flto-jobs in clang's link argumentsDylan Baker
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 Claessens
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 Baker
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 Bilaniuk
Suggested by Dylan Baker.
2021-02-09mtest: TestSetup can have [] as an exe_wrapperPaolo Bonzini
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 Pakkanen
2021-02-08Fix exe wrapper detection for run targets.Jussi Pakkanen
2021-02-07Add Qt6 moduleLuca Weiss
2021-02-07Make installing non-existing subdirs a supported featurePeter Hutterer
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 Pakkanen
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen
run_target: Add env kwarg
2021-02-06interpreterbase: Add support for optional arguments to typed_pos_argsDylan Baker
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 Baker
This allows functions like `files()` to be decorated.
2021-02-06interpreterbase: Add a helper method for typing positional argumentsDylan Baker
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 Schwartz
2021-02-05run_unittests: fix undefined variable in error messageEli Schwartz
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 Schwartz
In commit 591e6e94b9fccfc49ee7093cb21735a27fd64005 we somehow ended up with an identical extra copy.
2021-02-05unittests: fix error message stringDylan Baker
2021-02-05run_target: Add env kwargXavier Claessens
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 Claessens
Closes: #1281
2021-02-02Add support for LLVM's thinLTODylan Baker
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 Baker
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 Bonzini
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 Pakkanen
mtest: improvements to logging
2021-01-29Can read project version from a file.Jussi Pakkanen
2021-01-26dist: Allow packaging subproject in same git repo as main projectXavier Claessens
2021-01-22unittests: use utf-8 encoding for child processesPaolo Bonzini
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 Bonzini
2021-01-20unittests: Remove double install for case 10Fini Jastrow
[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 Jastrow
[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 Pakkanen
2021-01-18Fix cases where text leaks to stdout in unit tests.Jussi Pakkanen
2021-01-14coredata: Add missing nopromote wrap_mode choiceXavier Claessens
2021-01-13Fix misspellsAntonin Décimo
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-12summary: align left, not align middleEli Schwartz
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
2021-01-12Allow '//' as project function id due to git bash path conversion.Luke Elliott
See https://stackoverflow.com/questions/54258996/git-bash-string-parameter-with-at-start-is-being-expanded-to-a-file-path
2021-01-11boost: default machine file properties to env var valuesDylan Baker
This both moves the env reading to configuration time, which is useful, and also simplifies the implementation of the boost dependency. The simplification comes from being able to delete basically duplicated code since the values will be in the Properties if they exist at all.
2021-01-11Move BinaryTable environment lookups to EnvironmentDylan Baker
This means that all the env lookups are done once, at initial configure time. This has all of the expected advantages.
2021-01-11pull env to program mappings out of BinaryType classDylan Baker
These really aren't pivotal to that class, and they're used outside of it. In a follow up patch they're not going to be used inside it at all.
2021-01-11rename cflags_mapping to CFLAGS_MAPPINGDylan Baker
This is PEP8 convention for a const variable. Also, make the type Mapping, which doesn't have mutation methods. This means mypy will warn us if someone tries to change this.
2021-01-11unittests: Clang on windows can use either ld or link.exeDylan Baker
it generally uses the ld style linkers with msys2 and link.exe style linkers otherwise, but anything's possible.
2021-01-10Merge pull request #8029 from bonzini/mtest-asyncio-nextJussi Pakkanen
mtest: asynchronous TAP parsing, improved progress report
2021-01-10Hotdoc: use template for Commands.md instead of generating the entire file ↵Eli Schwartz
(#8154) * doc: fix hotdoc misuse for dynamically generated content hotdoc has a native include feature for including files inline. Use this to generate one file for each dynamically generated code block, and include that file in Commands.md; see: https://hotdoc.github.io/syntax-extensions.html#smart-file-inclusion-syntax This permits us to move back to using the in-tree version of the hotdoc *.md sources, thus fixing the incorrect inclusion of "builddir/" in the "Edit on github" links which resulted from using copies as the source. Fixes #8061 * doc: call the dummy file a "stamp" as it is a better known term
2021-01-07mtest/TAPParser: use typing.NamedTuplePaolo Bonzini
It is cleaner than collections.namedtuple. It also catches that "count()" is a method on tuple, so rename the field to num_tests. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-06mtest: remove argument to the TAPParser constructorPaolo Bonzini
Pass the StringIO object to the parse method instead, because there will be no T.Iterator[str] to use in the asynchronous case. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-04Use a single coredata dictionary for optionsDylan Baker
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04move OptionKey to mesonlibDylan Baker
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker
2021-01-04use OptionKey for coredata.user_optionsDylan Baker