summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAgeFilesLines
...
* interpreter: Add summary of all user defined optionsXavier Claessens2021-09-021-1/+7
| | | | | | | | | It is a commonly needed information to help debugging build issues. We already were printing options with non-default value at the end of the configure but outside of the summary. Keeping the list of user defined options in the interpreter will also in the future be useful to use new default value on reconfigure.
* run_target: do not yield broken names with subdirsEli Schwartz2021-09-011-0/+2
| | | | | | | A run_target object created in a subdir/meson.build always has a ninja rule name of "name", not "subdir/name". Fixes #9175
* msvc: Assume UTF8 source by defaultXavier Claessens2021-09-011-0/+13
| | | | | | | | | | | | Currently every project that uses UTF8 for its source files must add '/utf-8' argument otherwise they don't work non-English locale MSVC. Since meson.build itself is assumed to be UTF8 by default, seems better to assume it for source files by default too. For example: - https://gitlab.freedesktop.org/gstreamer/gst-build/-/blob/master/meson.build#L62 - https://gitlab.gnome.org/GNOME/glib/-/blob/main/meson.build#L29
* interpreter: use python dunders instead of lock for unpicklabilityDylan Baker2021-08-311-1/+1
| | | | | | | This simplifies things for us, as we don't have to have threading imported for no other reason, and we can remove the `an_unpicklable_object` from the Interpreter and mesonlib, since there was only one user of this.
* unittests: add a test to Interpreter is unpicklableDylan Baker2021-08-311-7/+17
| | | | We want this, so let's test it.
* pylint: turn on superflous-parensDylan Baker2021-08-311-1/+1
| | | | | | | | We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
* Merge pull request #9193 from dcbaker/submit/aarch64-beJussi Pakkanen2021-08-311-0/+95
|\ | | | | Handle aarch64_be as a cpu family
| * environment: correctly handle cpu value aarch64_beDylan Baker2021-08-301-0/+4
| | | | | | | | Fixes #9191
| * environment: add ppc -> ppc64 for aix to detect_cpuDylan Baker2021-08-301-1/+1
| | | | | | | | | | This seems like an oversight, that we'd replace ppc with ppc64 on AIX for the cpu_family, but not for the specific cpu.
| * unittests: add tests for detect_cpuDylan Baker2021-08-301-0/+35
| | | | | | | | Same thing, but for the more specific cases
| * unittests: Add a test case for detect_cpu_familyDylan Baker2021-08-301-0/+56
| | | | | | | | This should help prevent regressions.
* | decorators: Make unknown kwarg fatalXavier Claessens2021-08-301-3/+3
|/
* interpreter: fix cases of `KwargInfo(..., T, default=None)`Dylan Baker2021-08-271-7/+8
| | | | | | The correct way to mark these is `KwargInfo(..., (T, type(None)))`. There's also a few cases of `(T, None)` which is invalid, as `None` isn't a type
* interpreter: Add a helper for checking constrained inputsDylan Baker2021-08-271-1/+2
| | | | | This is quite valuable for enum-like inputs, where only a certain set of values is allowed.
* interpreter: Fix dependency(..., static: true) fallbackXavier Claessens2021-08-231-0/+5
| | | | | | | It should build the fallback subprject with default_library=static and override the dependency for both static=True and static kwarg not given. Fixes: #8050.
* unittests: Ensure that symlink is removed after tests completeDylan Baker2021-08-201-3/+7
| | | | | using `TestCase.addCleanup` is both neat and tidy, and also ensures that the cleanup will be done, even if the test fails.
* Add install tagsXavier Claessens2021-08-171-9/+116
| | | | Fixes: #7007.
* interpreter/compiler: Add type checking for the Compiler objectDylan Baker2021-08-161-7/+2
| | | | | This adds a full set of `typed_pos_args` and `typed_kwarg` decorations, as well as fixing all of the typing errors reported by mypy.
* unittests/base: Allow init method to failDylan Baker2021-08-161-11/+29
| | | | | | | This adds a new keyword argument to the init method, `allow_fail`. When set to True (default is False) then a failure to configure is not an error, and output is still returned. This can be useful for cases where we expect initialization to fail, and want to check the output.
* unittests/base: Move code out of the try block of a try/except statementDylan Baker2021-08-161-15/+18
| | | | | | | There are two problems with having this in the try/except block. The first is that both of the if statements will raise, and the except statement cathces `Exception`, so it catches these two cases, prints a message that we either don't want or already printed, then re-raises.
* unittests/baseplatform: don't double print on errorDylan Baker2021-08-161-2/+4
|
* editorconfig: add setting to trim trailing whitespaceEli Schwartz2021-08-1512-18/+5
| | | | | | | and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
* run_unittests: fix unused variable warningsEli Schwartz2021-08-151-2/+2
| | | | | | | | We don't actually want to do anything with the open()ed file, just immediately close it. The CalledProcessError doesn't have its return returncode checked here, even though other code with the same type of context manager does.
* Revert "compilers/c++: Add MSVC option to make the __cplusplus define accurate"Jussi Pakkanen2021-08-151-0/+1
| | | | This reverts commit 0b97d585480e973d8b149618901f7a4ddfa1a906.
* compilers/c++: Add MSVC option to make the __cplusplus define accurateDylan Baker2021-08-111-1/+0
| | | | | Otherwise it always returns the value for c++98, starting with MSVC 2017 15.7 or later. Earlier versions are not affected by this mis-feature
* interpreter: Fix missing subsubproject summary when subproject failsXavier Claessens2021-08-091-0/+5
| | | | | | In the case main->subp->subsubp, if subsubp succeed to configure but subp subsequentially fails, subsubp is still being built but its summary was missing.
* pkg-config: support for `-l:libfoo.a`lilinzhe2021-08-091-0/+43
| | | | | | | | | fixs: #9000 Meson not correctly process with -l:xxx.a link arguments in pkgconfig .pc file. see also:https://stackoverflow.com/questions/48532868/gcc-library-option-with-a-colon-llibevent-a with unit test, unit test will be partially skiped if pkg-config version < 0.28 . see: https://gitlab.freedesktop.org/pkg-config/pkg-config/-/blob/master/NEWS
* Fix --force-fallack-for with --wrap-mode=nofallbackXavier Claessens2021-08-071-0/+6
| | | | Fixes: #9065
* Escape path in exclude filter passed to gcovrAlois Wohlschlager2021-08-041-0/+20
| | | | | | Gcovr interprets exclude filters, as passed to the -e option, as regexes. Since we want to exclude a raw path, the argument must be escaped.
* destdir: Allow relative to build directoryXavier Claessens2021-08-041-0/+6
| | | | | | Meson already works like that, except in do_copydir() that requires absolute destdir. Better explicitly support that instead of leaving it undefined and unconsistent.
* interenaltests: Add some version strings with ansi escapes in themDylan Baker2021-07-301-0/+11
| | | | | AS we've run into a few programs using ansi escapes in their version outputs, we'd like to test them as well.
* Split run_unittests.py fileXavier Claessens2021-07-2615-0/+10715