mirror of
https://gitlab.com/qemu-project/meson.git
synced 2025-11-08 21:18:48 +08:00
Add option to fail fast in tests
This commit is contained in:
@ -30,10 +30,11 @@ import argparse
|
||||
from run_project_tests import gather_tests, run_tests, StopException, setup_commands
|
||||
from run_project_tests import failing_logs
|
||||
|
||||
def runtests(cross_file):
|
||||
def runtests(cross_file, failfast):
|
||||
commontests = [('common', gather_tests(Path('test cases', 'common')), False)]
|
||||
try:
|
||||
(passing_tests, failing_tests, skipped_tests) = run_tests(commontests, 'meson-cross-test-run', ['--cross', cross_file])
|
||||
(passing_tests, failing_tests, skipped_tests) = \
|
||||
run_tests(commontests, 'meson-cross-test-run', failfast, ['--cross', cross_file])
|
||||
except StopException:
|
||||
pass
|
||||
print('\nTotal passed cross tests:', passing_tests)
|
||||
@ -47,10 +48,11 @@ def runtests(cross_file):
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--failfast', action='store_true')
|
||||
parser.add_argument('cross_file')
|
||||
options = parser.parse_args()
|
||||
setup_commands('ninja')
|
||||
return runtests(options.cross_file)
|
||||
return runtests(options.cross_file, options.failfast)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user