aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
AgeCommit message (Collapse)AuthorFilesLines
2020-09-10Split tests out from 'common' which require a native compilerJon Turney1-1/+1
Split out tests (and parts of tests) which require a native compiler from the 'common' suite to a new suite called 'native', so we can selectively avoid running those tests when only a cross-compiler is available. Also move test '211 cmake module' to 'cmake' suite, since it appears that the way we use cmake requires a native compiler.
2020-09-09Add a test of add_languages(native:) introspectionJon Turney1-0/+8
If the meson.build doesn't use a native compiler, the native compiler options (e.g. 'c_args') shouldn't be present in the output of 'meson introspect --buildoptions'.
2020-09-08Fix picking up tools with args from the env on WindowsNirbheek Chauhan1-2/+18
This was a regression in https://github.com/mesonbuild/meson/pull/7059. We do not need to do a full search for all windows special cases. We only want to check whether the command provided is actually a full path to a script so we can add the interpreter. Fixes https://github.com/mesonbuild/meson/issues/7645
2020-09-04introspect: add test dependencies info to test/benchmark JSONPaolo Bonzini1-0/+18
Add the ids of any target that needs to be rebuilt before running the tests as computed by the backend, to the introspection data for tests and benchmarks. This also includes anything that appears on the test's command line. Without this information, IDEs must update the entire build before running any test. They can now instead selectively build the test executable itself and anything that is needed to run it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-02Special case meson.version().version_compare() statementXavier Claessens1-0/+5
when that statement gets evaluated, the interpreter remembers the version target and if it was part of the evaluation of a `if` condition then the target meson version is temporally overriden within that if-block. Fixes: #7590
2020-08-30unittests: continue on exception instead of breakJames Hilliard1-1/+1
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-08-30D: fix include orderPierrick Bouvier1-0/+6
Commit 93c3ec7e introduced a new way to handle deduplication with compiler args. This resulted in D includes to be reversed.
2020-08-27tests: make chdir more robust in run_unittests.pyDaniel Mensinger1-2/+4
2020-08-27Fix typo when fetching buildtype option for compiler checksNirbheek Chauhan1-0/+53
This type happened in https://github.com/mesonbuild/meson/pull/7432 and wasn't noticed because I didn't add a test for it. Rectified now. If we don't specify the CRT, MSVC will pick /MT by default (!?) and link to `libcmt.lib`. This actually *breaks* UWP because `libcmt.lib` is not available by default when building for UWP. Was noticed here: https://github.com/cisco/libsrtp/pull/505
2020-08-20Skip nostdlib test on non-x86(_64) platformsmakise-homura1-1/+2
2020-08-18Interpreter: Fix c_stdlib usageXavier Claessens1-0/+22
- Exceptions raised during subproject setup were ignored. - Allow c_stdlib in native file, was already half supported. - Eliminate usage of subproject variable name by overriding '<lang>_stdlib' dependency name.
2020-08-15ninjabackend: Fix coverage rule generationNirbheek Chauhan1-0/+17
Without the parenthesis, the command evaluates to `[]` if `use_llvm_cov` is `False`. Also fix tests to actually check whether or not coverage reports are generated. Fixes https://github.com/mesonbuild/meson/issues/7553
2020-08-12interpreter: Don't force fallback when subproject failed to configureXavier Claessens1-0/+18
Fixes: #7534
2020-08-12Test for spurious warning from get_target_filenamePaolo Bonzini1-0/+8
Fixed by #7494 without a test, so here's a test. Extracted from https://github.com/mesonbuild/meson/pull/7539
2020-08-04"Downgrade" warning when regenerating after version bumpZbigniew Jędrzejewski-Szmek1-2/+2
There is nothing to "warn" about, this is a completely routine occurence. OTOH, when something is corrupted, we should warn. Keep the red color and "WARNING:" prefix in that case. Example output: $ ninja -C build Regenerating configuration from scratch: Build directory has been generated with Meson version 0.55.999, which is incompatible with current version 0.56.0. The Meson build system Version: 0.56.0 ...
2020-08-04Capitalize some constants in coredataJohn Ericson1-3/+3
I've been getting confused between them and similarly-named other things, so I figured it was high time to clean this up.
2020-08-01run dircondensor.pyDylan Baker1-7/+7
2020-08-01Put machine file and cmd line parsing in EnvironmentDylan Baker1-2/+59
This creates a full set of option in environment that mirror those in coredata, this mirroring of the coredata structure is convenient because lookups int env (such as when initializing compilers) becomes a straight dict lookup, with no list iteration. It also means that all of the command line and machine files are read and stored in the correct order before they're ever accessed, simplifying the logic of using them.
2020-08-01machine-files: deprecate the paths sectionDylan Baker1-0/+34
2020-08-01Allow setting built-in options from cross/native filesDylan Baker1-2/+151
This is like the project options, but for meson builtin options. The only real differences here have to do with the differences between meson builtin options and project options. Some meson options can be set on a per-machine basis (build.pkg_config_path vs pkg_config_path) others can be set on a per-subproject basis, but should inherit the parent setting.
2020-07-30Allow setting project options from cross or native filesDylan Baker1-1/+82
This allows adding a `[project options]` section to a cross or native file that contains the options defined for a project in it's meson_option.txt file.
2020-07-30pkgconfig: Fix various corner casesXavier Claessens1-0/+13
See unit tests for the exact scenarios this PR fixes.
2020-07-30backends: fix rpath match patternJames Hilliard1-12/+27
Since -Wl,-rpath= is not the only valid rpath ldflags syntax we need to try and match all valid rpath ldflags. In addition we should prevent -Wl,--just-symbols from being used to set rpath due to inconsistent compiler support. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-07-28ninjabackend: check if target has compiler attributeMarcel Hollerbach1-1/+19
otherwise we are getting errors like: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mesonbuild/mesonmain.py", line 131, in run return options.run_func(options) File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 245, in run app.generate() File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 159, in generate self._generate(env) File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 215, in _generate intr.backend.generate() File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 518, in generate self.generate_coverage_rules() File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 991, in generate_coverage_rules self.generate_coverage_command(e, []) File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 975, in generate_coverage_command for compiler in target.compilers.values(): AttributeError: 'RunTarget' object has no attribute 'compilers' This extends the 109 generatecode test case to also define a test, so coverage can really detect something.
2020-07-23Merge pull request #7461 from mensinda/noMoreSetuptoolsJussi Pakkanen1-0/+32
Remove the setuptools dependency with mesondata.py
2020-07-21summary: Wrap lines when printing listsXavier Claessens1-0/+4
When a list_sep is provided (e.g. ', ') all items are printed on the same line, which gets ugly on very long lists (e.g. list of plugins enabled).
2020-07-20Do not add rpaths for static libs. Closes #5191.Jussi Pakkanen1-0/+7
2020-07-16mdata: Add test to ensure mesondata.py is up-to-dateDaniel Mensinger1-0/+32
2020-07-12Check that hg is actually working.Jussi Pakkanen1-2/+18
2020-07-02Skip doc test when docs are not available.Jussi Pakkanen1-0/+3
2020-07-01Implicit dependency fallback when a subproject wrap or dir existsXavier Claessens1-0/+5
2020-06-30Made Commands.md dynamically generated (#7346)TheQwertiest1-86/+19
2020-06-30wrap: Apply patch even in VCS casesXavier Claessens1-0/+19
2020-06-29envconfig: Add [constants] section in machine filesXavier Claessens1-2/+32
Machine files already supports `+` operator as an implementation detail, since it's using eval(). Now make it an officially supported feature and add a way to define constants that are used while evaluating an entry value.
2020-06-29Added ability to specify target in `meson compile`TheQwertiest1-9/+59
2020-06-28Added ability to pass arguments to backend in `meson compile`TheQwertiest1-0/+15
2020-06-24pkgconfig: Add missing cflags in uninstalled filesXavier Claessens1-2/+3
Fixes: #7365
2020-06-22unittests: Fix 51 ldflagdedup on SolarisAlan Coopersmith1-0/+5
If the linker doesn't support --export-dynamic, skip test to deduplicate it, since it always fails finding 0 copies instead of 1.
2020-06-22unittests: Fix test_compiler_detection on SolarisAlan Coopersmith1-0/+2
Accept Solaris linker in addition to GNU linker. Previously using the system provided gcc (which calls the Solaris linker) caused it to fail with: ====================================================================== FAIL: test_compiler_detection (__main__.AllPlatformTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "run_unittests.py", line 2525, in test_compiler_detection self.assertIsInstance(cc.linker, mesonbuild.linkers.GnuLikeDynamicLinkerMixin) AssertionError: <SolarisDynamicLinker: v9.2.0 `gcc`> is not an instance of <class 'mesonbuild.linkers.GnuLikeDynamicLinkerMixin'> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-22compilers: Return CompilerArgs from compiler instanceDylan Baker1-12/+8
Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method.
2020-06-22compilers: Split CompilerArgs into a separate moduleDylan Baker1-5/+5
I've also moved this out of the compilers pacakge because we're soon going to need it in linkers, and that creates some serious spagetti
2020-06-17disable coverage tests on msys2Cary Converse1-0/+8
2020-06-17coverage: llvm-cov supportCary Converse1-15/+68
2020-06-16interpreter: add support for --force-fallback-forMathieu Duponchelle1-0/+6
This new command line option allows specifying dependencies for which to force fallback. See the documentation for more information Fixes: #7218
2020-06-15pep8: add missing import, remove unused variableMichael Hirsch1-25/+26
2020-06-15run_*tests*.py: print Meson version at start of test suiteMichael Hirsch1-0/+1
on some systems, tests may take over an hour to run--only to find you might have used an unintended Meson version (e.g. release instead of dev). This change prints the Meson version at the start of the run_*tests*.py scripts. Also, raise SystemExit(main()) is preferred in general over sys.exit(main())
2020-06-15environment: fallback regex for versions like 2020.01Michael Hirsch1-4/+10
add four-digit version unit_test cases
2020-06-15Added docs for all meson commands + corresponding unit test (#7217)TheQwertiest1-0/+113
2020-06-11unit tests: Pass args to pytestNirbheek Chauhan1-0/+3
Gets --help working and --failfast too.
2020-06-11compilers: corretify deduplication directionMarcel Hollerbach1-0/+19
so: when building compile args, meson is deduplicating flags. When a compiler argument is appended, a later appearance of a dedup'ed is going to remove a earlier one. If the argument is prepended, the element *before* the new one is going to be removed. And that is where the problem reported in https://github.com/mesonbuild/meson/pull/7119 is coming in. In the revision linked there, the order of replacement in the prepend case was revesered. With this patch, we restore this behaviour again.