Skip to content

Commit

Permalink
mtest: Fix mtest for new test targets
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbaker committed Jan 25, 2020
1 parent a613125 commit aec3478
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mesonbuild/mtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ def list_tests(th: TestHarness) -> bool:
print(th.get_pretty_suite(t))
return not tests

def rebuild_all(wd: str) -> bool:
def rebuild_all(wd: str, benchmark: bool) -> bool:
if not (Path(wd) / 'build.ninja').is_file():
print('Only ninja backend is supported to rebuild tests before running them.')
return True
Expand All @@ -997,7 +997,9 @@ def rebuild_all(wd: str) -> bool:
print("Can't find ninja, can't rebuild test.")
return False

ret = subprocess.run([ninja, '-C', wd]).returncode
target = 'meson-build-benchmarks' if benchmark else 'meson-build-tests'

ret = subprocess.run([ninja, '-C', wd, target]).returncode
if ret != 0:
print('Could not rebuild {}'.format(wd))
return False
Expand Down Expand Up @@ -1031,7 +1033,7 @@ def run(options: argparse.Namespace) -> int:
options.wd = os.path.abspath(options.wd)

if not options.list and not options.no_rebuild:
if not rebuild_all(options.wd):
if not rebuild_all(options.wd, options.benchmark):
# We return 125 here in case the build failed.
# The reason is that exit code 125 tells `git bisect run` that the current commit should be skipped.
# Thus users can directly use `meson test` to bisect without needing to handle the does-not-build case separately in a wrapper script.
Expand Down

0 comments on commit aec3478

Please sign in to comment.