-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mtest: fix rebuilding all before running tests
If an explicit list of targets is passed on the CLI, then that is passed to rebuild_deps. If not, we pass every loaded test to rebuild_deps instead. This means we cannot distinguish between "trying to run all tests" and "trying to run specific tests". We then load all the deps for all tests, and try to build them all as explicit arguments to the underlying ninja. This is usually papered over by people running `ninja test`, which depends on "all" anyway as a prerequisite for invoking the underlying `meson test --no-rebuild --print-errorlogs`, however, instead running `meson setup builddir && meson test -C builddir` with under-specified test deps would actually build a handful of deps and not anything else, then fail. Instead, pass no tests to rebuild_deps, so that we iterate over nothing and add no explicit targets. Hence, meson rebuilds the default "all" rule.
- Loading branch information
1 parent
5d0538d
commit ed6b33e
Showing
5 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
int main(void) { return 0 ; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
project('underspecified deps', 'c') | ||
|
||
runner = find_program('runner.py') | ||
exe1 = executable('main1', 'main.c') | ||
exe2 = executable('main2', 'main.c') | ||
|
||
test('runner-with-exedep', runner, args: exe1) | ||
test('runner-without-dep', runner, args: exe2.full_path()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys, subprocess | ||
|
||
subprocess.run(sys.argv[1:], check=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters