| Age | Commit message (Collapse) | Author |
|
This simplifies a bunch of cases, and likely fixes some annoying bugs
in cross compile situations where should have been passing this and
weren't.
|
|
I missed this in 9104bb616766bd9a05f0b2f280359463d32e227d as we were only
testing whitelisted languages for source file discovery.
Tests now handle all of these by using the map we have in compilers, as
we need to know the suffix to use for the invalid source files we inject.
Note that for tests, we mix explicit --lang in some cases and not others,
which we could probably do better with. For these 'must fail' tests, I've
stuck with explicit `--lang` to make sure we're testing what we want,
but the others are perhaps up for debate.
Bug: https://github.com/mesonbuild/meson/issues/15286
|
|
|
|
* In 1.7.1, the behaviour of --executable was to just ignore it.
* After my recent 9104bb616766bd9a05f0b2f280359463d32e227d, the behaviour
was that we'd require, for --executable xyz, xyz.c to exist or we'd
fail to generate.
Neither are good! Instead, create the sample source file w/ the project
name, but call the executable whatever the user passed with `--executable`.
Bug: https://github.com/mesonbuild/meson/issues/15286
|
|
Use `itertools.product()` to reduce an indentation level or two, though
we lose one again by changing to a function for fresh vs dirty.
I plan on adding more to these tests and it makes it a bit more manageable.
Best-viewed-with: --ignore-all-space
|
|
|
|
Respect collected sources for `meson init` as well as --executable. This
regressed in 9f0ac314ba0c54cc18c2499845324efc14c1849e (part of
https://github.com/mesonbuild/meson/pull/14086, it's easier to see how with
the whole PR).
Also, add subtests (distinguishing between empty directories and those with some
file(s) within). We already had some of these but they weren't marked
as such.
Test `meson init` with a broken source file in the source directory as
we should fail with that, not ignore the file.
It's easier to test with a broken file than a working one as we can assert
the build should fail, it'll pass with just the 1 example file we generate.
Closes: https://github.com/mesonbuild/meson/issues/15286
|
|
Compiler.symbols_have_underscore_prefix
|
|
|
|
If the first line already conained a match, the former regex didn't
catch it correctly, because it was looking for a newline character to
detect the start of a line.
The new regex is using the proper `^` to match the beginning of a line.
For this to work as expected the `re.MULTILINE` flag has to be set.
|
|
This info is also available from the "result" entry, but requires
mapping result types to "would cause a failure, but isn't literally
FAIL". It comes in handy for the meson testsuite, too.
|
|
If a CustomTargetIndex is passed as an argument to a test, running meson
test (with no test glob) does not automatically build the custom_target
before running the test, because CustomTargetIndex outputs are not added
as prerequisites to the meson-test-prereq and meson-benchmark-prereq
targets.
Fixes: #14743
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This makes easier to run a single test after running them all. For
example the test "test_accsadubl" in the suite "default" of project
"orc" used to be displayed "orc:default / test_accsadubl". To run that
test specifically the command line is `meson test -C builddir
orc:test_accsadubl --suite default`. To make this more consistent
the test is now displayed as "default - orc:test_accsadubl".
|
|
Omitting test()'s `suite` kwarg used to default to `test.suite==['']`
because of how stringlistify() works. That had inconsistent behavior
with `suite: []` which makes `test.suite==[]`. That changed when porting
to typed_kwarg (#8855), which made the default `test.suite==[]`.
Change `suite: []`, and missing kwarg, back to `test.suite==['']` which
was the original intention. It has impact on `meson test --suite`
selection, an empty `test.suite` list means that test is never going to
be selected when `--suite` is used, even when we want all tests from a
given subproject.
It was also unclear what `--suite foo` means. Is `foo` a suite or a
project name? It can now be either, it selects all tests from project
`foo` as well as all tests from any project in suite `foo`.
|
|
The two methods are identical.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
|
This reverts commit 12563f74a9f3dda70dcd4778aa958de355d1fae7.
|
|
This reverts commit 651aede977179c5fe382744e3dd91ca8e01d050c.
This was most certainly not acceptable.
|
|
|
|
We might run into an assertion failure down the road, if we don't fail
here. Specifically
project('proj')
executable('bin', 'header.h')
will throw during the ninja generation.
|
|
Fixes #14840
|
|
The introspection interpreter sometimes produces targets with no source
files; BuildTarget will then pick a random compiler, according to the
order in clink_langs.
According to the comment in sort_clink, clink_langs are supposed
to list languages from *lowest* to highest priority. However,
process_compilers_late() process clink_langs in straight order and
returns the first language; which is the one with lowest priority.
This became visible with the addition of Rust to clink_langs,
because Rust has limitation on the names of library targets, but
the bug existed before.
Fixes: e49f2f7283e1d9f18e2f5f54647c07287cd70339
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
This is required by meson-python to fix RPATH entries when building a wheel.
|
|
Check that build options fall back to host options, and that they
can be retrieved with get_option.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This commit completes 5de09cbe8838e8febf1ca3aa83b53cf06972bff3,
ensuring that only POSIX style paths are passed to the compiler
line, and thus fixing UNIX-style tools that treat single
backward slashes as Unicode escaped characters.
Fixes #12191
Completes #12534
Completes #12564
|
|
it uses the existing 14 configure file test case to configure
config 7 and 10 with cmake and meson and then compares the
relevant output to see if they are equal
|
|
This wraps all of the compiler detections in this test case in
try/except blocks. These blocks will return a skipTest for Python >=
3.11 (where subTest and skipTest interact correctly), and continue if
they do not. For Meson CI runs they will fail the specific subtest,
which is also an improvement as it can help pinpoint exactly which
subtest failed.
Fixes: #14579
|
|
Add a few asserts for functions that could in theory return None, but if
they do something has gone *really* wrong with the test.
|
|
Which is a very large and complicated test function
|
|
ELD is Qualcomm's open-source embedded linker.
https://github.com/qualcomm/eld
Signed-off-by: Kushal Pal <kushpal@qti.qualcomm.com>
|
|
DirectoryLock provides a generic locking implementation the replaces the
previously used BuildDirLock.
|
|
Change the semantics of IntrospectionBuildTarget.source_nodes
and IntrospectionBuildTarget.extra_files .
The rewriter and the static introspection tool used to be very broken,
now it is *less* broken, hence we add some tests in this commit.
Fixes #11763
|
|
On Windows, os.execv spawn the process in background and returns 0.
Therefore, it prevents devenv to return proper exit code from the
called process. (see https://github.com/python/cpython/issues/63323
for reference.)
The solution is to call subprocess.run instead, on Windows, at the
price of keeping the meson python process alive while the devenv
subprocess runs.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The unit tests for the `meson test --slice=` option check that the
option is working by extracting all tests that have been run from the
command output. This is done with a rather loose regular expression
"test-[0-9]*", which can easily match other parts of the output, as
well.
One user for example reported that the test broke because they were
executing tests in a directory called "meson-test-1.8.0-build", and
given that the "test-1" part of that directory matches the regular
expression we have too many matches.
Fix the issue by tightening the regex so that is way less likely to
match anything from the host's build environment.
Reported-by: Dominique Leuenberger <dleuenberger@suse.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
validate_original_args only checks whether an option is prefixed with the name of a
built-in option that was also set. It does not check whether the prefix is the full
name of the option specified with -D. Adding an "=" at the end fixes the test.
Fixes: #14487
Reported-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Otherwise they won't be able to find their module outputs.
This requires a new method to look at dependencies, as the existing ones
wont find static libraries that were linked statically into previous
targets (this links with A which link_whole's B). We still need to have
B in that case because we need it's BMI outputs.
|
|
Because we don't set the appropriate dependencies
|
|
|
|
Another rust tool, another rough copy of the code to run clippy.
Apart from the slightly different command lines, the output is in a
directory and test targets are skipped.
Knowing the output directory can be useful, so print that on successful
execution of rustdoc.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
In the preceding commit we have started to perform compiler checks for
the value of `b_sanitize`, which allows us to detect sanitizers that
aren't supported by the compiler toolchain. But we haven't yet loosened
the option itself to accept arbitrary values, so until now it's still
only possible to pass sanitizer combinations known by Meson, which is
quite restrictive.
Lift that restriction by adapting the `b_sanitize` option to become a
free-form array. Like this, users can pass whatever combination of
comma-separated sanitizers to Meson, which will then figure out whether
that combination is supported via the compiler checks. This lifts a
couple of restrictions and makes the supporting infrastructure way more
future proof.
A couple of notes regarding backwards compatibility:
- All previous values of `b_sanitize` will remain valid as the syntax
for free-form array values and valid combo choices is the same. We
also treat 'none' specially so that we know to convert it into an
empty array.
- Even though the option has been converted into a free-form array,
callers of `get_option('b_sanitize')` continue to get a string as
value. We may eventually want to introduce a kwarg to alter this
behaviour, but for now it is expected to be good enough for most use
cases.
Fixes #8283
Fixes #7761
Fixes #5154
Fixes #1582
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
|
|
|
|
When running tests with `--interactive` we don't redirect stdin, stdout
or stderr and instead pass them on to the user's console. This redirect
causes us to hang in case the test in question needs parsing, like it is
the case for TAP output, because we cannot read the process's stdout.
Fix this hang by not parsing output when running in interactive mode.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
Executing tests can take a very long time. As an example, the Git test
suite on Windows takes around 4 hours to execute. The Git project has
been working around the issue by splitting up CI jobs into multiple
slices: one job creates the build artifacts, and then we spawn N test
jobs with those artifacts, where each test job executes 1/Nth of the
tests.
This can be scripted rather easily by using `meson test --list`,
selecting every Nth line, but there may be other projects that have a
similar need. Wire up a new option "--slice i/n" to `meson test` that
does implements this logic.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|