Dylan Baker
f073c3cfe1
environment: correctly handle cpu value aarch64_be
...
Fixes #9191
3 years ago
Dylan Baker
78f8a286d0
environment: add ppc -> ppc64 for aix to detect_cpu
...
This seems like an oversight, that we'd replace ppc with ppc64 on AIX
for the cpu_family, but not for the specific cpu.
3 years ago
Dylan Baker
b8cdae7003
unittests: add tests for detect_cpu
...
Same thing, but for the more specific cases
3 years ago
Dylan Baker
84fff3521a
unittests: Add a test case for detect_cpu_family
...
This should help prevent regressions.
3 years ago
Dylan Baker
11fbaf29d8
interpreter: fix cases of `KwargInfo(..., T, default=None)`
...
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
3 years ago
Dylan Baker
aa895b383c
interpreter: Add a helper for checking constrained inputs
...
This is quite valuable for enum-like inputs, where only a certain set
of values is allowed.
3 years ago
Xavier Claessens
e646130ef1
interpreter: Fix dependency(..., static: true) fallback
...
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 .
3 years ago
Dylan Baker
e0ab7290f0
unittests: Ensure that symlink is removed after tests complete
...
using `TestCase.addCleanup` is both neat and tidy, and also ensures that
the cleanup will be done, even if the test fails.
3 years ago
Xavier Claessens
8c5aa031b5
Add install tags
...
Fixes : #7007 .
3 years ago
Dylan Baker
b30dddd4e5
interpreter/compiler: Add type checking for the Compiler object
...
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.
3 years ago
Dylan Baker
5fe03cf8d9
unittests/base: Allow init method to fail
...
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.
3 years ago
Dylan Baker
310d7d13f4
unittests/base: Move code out of the try block of a try/except statement
...
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.
3 years ago
Dylan Baker
7daed5faf8
unittests/baseplatform: don't double print on error
3 years ago
Eli Schwartz
59d4f771d2
editorconfig: add setting to trim trailing whitespace
...
and clean up all outstanding issues
Skip 'test cases/common/141 special characters/meson.build' since it
intentionally uses trailing newlines.
3 years ago
Eli Schwartz
ead4ba7777
run_unittests: fix unused variable warnings
...
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.
3 years ago
Jussi Pakkanen
a90d2925dd
Revert "compilers/c++: Add MSVC option to make the __cplusplus define accurate"
...
This reverts commit 0b97d58548
.
3 years ago
Dylan Baker
0b97d58548
compilers/c++: Add MSVC option to make the __cplusplus define accurate
...
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
3 years ago
Xavier Claessens
5462ea921f
interpreter: Fix missing subsubproject summary when subproject fails
...
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.
3 years ago
lilinzhe
dd2e3bf446
pkg-config: support for `-l:libfoo.a`
...
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
3 years ago
Xavier Claessens
943596abbb
Fix --force-fallack-for with --wrap-mode=nofallback
...
Fixes : #9065
3 years ago
Alois Wohlschlager
40d5a38d1b
Escape path in exclude filter passed to gcovr
...
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.
3 years ago
Xavier Claessens
9da99e7a59
destdir: Allow relative to build directory
...
Meson already works like that, except in do_copydir() that requires
absolute destdir. Better explicitly support that instead of leaving it
undefined and unconsistent.
3 years ago
Dylan Baker
a450f8c6bc
interenaltests: Add some version strings with ansi escapes in them
...
AS we've run into a few programs using ansi escapes in their version
outputs, we'd like to test them as well.
3 years ago
Xavier Claessens
7eb4c23156
Split run_unittests.py file
3 years ago