mirror of
https://github.com/qemu/qemu.git
synced 2025-08-16 06:43:21 +00:00
iotests: check: return 1 on failure
We should indicate failure by exit code, not only output.
Reported-by: Peter Maydell
Fixes: f203080bbd
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210201085041.3079-1-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
ca502ca60d
commit
3ae50942f1
@ -140,4 +140,7 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
with TestRunner(env, makecheck=args.makecheck,
|
with TestRunner(env, makecheck=args.makecheck,
|
||||||
color=args.color) as tr:
|
color=args.color) as tr:
|
||||||
tr.run_tests([os.path.join(env.source_iotests, t) for t in tests])
|
paths = [os.path.join(env.source_iotests, t) for t in tests]
|
||||||
|
ok = tr.run_tests(paths)
|
||||||
|
if not ok:
|
||||||
|
sys.exit(1)
|
||||||
|
@ -318,7 +318,7 @@ def run_test(self, test: str,
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def run_tests(self, tests: List[str]) -> None:
|
def run_tests(self, tests: List[str]) -> bool:
|
||||||
n_run = 0
|
n_run = 0
|
||||||
failed = []
|
failed = []
|
||||||
notrun = []
|
notrun = []
|
||||||
@ -363,5 +363,7 @@ def run_tests(self, tests: List[str]) -> None:
|
|||||||
if failed:
|
if failed:
|
||||||
print('Failures:', ' '.join(failed))
|
print('Failures:', ' '.join(failed))
|
||||||
print(f'Failed {len(failed)} of {n_run} iotests')
|
print(f'Failed {len(failed)} of {n_run} iotests')
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
print(f'Passed all {n_run} iotests')
|
print(f'Passed all {n_run} iotests')
|
||||||
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user