mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-01 07:55:49 +00:00
Test.py exit code accurate in all cases (RIPD-1193):
* Also remove some redundant output.
This commit is contained in:
committed by
Miguel Portilla
parent
d46c21cc5f
commit
9cc80b7cb6
@@ -49,6 +49,7 @@ import os
|
|||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
@@ -196,22 +197,21 @@ def run_tests(args):
|
|||||||
resultcode, lines = shell(executable, (testflag,))
|
resultcode, lines = shell(executable, (testflag,))
|
||||||
|
|
||||||
if resultcode:
|
if resultcode:
|
||||||
print('ERROR:', *lines, sep='')
|
if not ARGS.verbose:
|
||||||
|
print('ERROR:', *lines, sep='')
|
||||||
failed.append([target, 'unittest'])
|
failed.append([target, 'unittest'])
|
||||||
if not ARGS.keep_going:
|
if not ARGS.keep_going:
|
||||||
break
|
break
|
||||||
ARGS.verbose and print(*lines, sep='')
|
|
||||||
|
|
||||||
if not ARGS.nonpm:
|
if not ARGS.nonpm:
|
||||||
print('npm tests for', target)
|
print('npm tests for', target)
|
||||||
resultcode, lines = shell('npm', ('test', '--rippled=' + executable,))
|
resultcode, lines = shell('npm', ('test', '--rippled=' + executable,))
|
||||||
if resultcode:
|
if resultcode:
|
||||||
print('ERROR:\n', *lines, sep='')
|
if not ARGS.verbose:
|
||||||
|
print('ERROR:\n', *lines, sep='')
|
||||||
failed.append([target, 'npm'])
|
failed.append([target, 'npm'])
|
||||||
if not ARGS.keep_going:
|
if not ARGS.keep_going:
|
||||||
break
|
break
|
||||||
else:
|
|
||||||
ARGS.verbose and print(*lines, sep='')
|
|
||||||
return failed
|
return failed
|
||||||
|
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ def run_build(args=None):
|
|||||||
print('Build FAILED:')
|
print('Build FAILED:')
|
||||||
if not ARGS.verbose:
|
if not ARGS.verbose:
|
||||||
print(*lines, sep='')
|
print(*lines, sep='')
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
if '--ninja' in args:
|
if '--ninja' in args:
|
||||||
resultcode, lines = shell('ninja')
|
resultcode, lines = shell('ninja')
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ def run_build(args=None):
|
|||||||
print('Ninja build FAILED:')
|
print('Ninja build FAILED:')
|
||||||
if not ARGS.verbose:
|
if not ARGS.verbose:
|
||||||
print(*lines, sep='')
|
print(*lines, sep='')
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -240,6 +240,8 @@ def main():
|
|||||||
else:
|
else:
|
||||||
to_build = [tuple(ARGS.scons_args)]
|
to_build = [tuple(ARGS.scons_args)]
|
||||||
|
|
||||||
|
all_failed = []
|
||||||
|
|
||||||
for build in to_build:
|
for build in to_build:
|
||||||
args = ()
|
args = ()
|
||||||
# additional arguments come first
|
# additional arguments come first
|
||||||
@@ -254,7 +256,10 @@ def main():
|
|||||||
if failed:
|
if failed:
|
||||||
print('FAILED:', *(':'.join(f) for f in failed))
|
print('FAILED:', *(':'.join(f) for f in failed))
|
||||||
if not ARGS.keep_going:
|
if not ARGS.keep_going:
|
||||||
exit(1)
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
all_failed.extend([','.join(build), ':'.join(f)]
|
||||||
|
for f in failed)
|
||||||
else:
|
else:
|
||||||
print('Success')
|
print('Success')
|
||||||
|
|
||||||
@@ -265,7 +270,12 @@ def main():
|
|||||||
os.remove('.ninja_deps')
|
os.remove('.ninja_deps')
|
||||||
os.remove('.ninja_log')
|
os.remove('.ninja_log')
|
||||||
|
|
||||||
|
if all_failed:
|
||||||
|
if len(to_build) > 1:
|
||||||
|
print()
|
||||||
|
print('FAILED:', *(':'.join(f) for f in all_failed))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
exit(0)
|
sys.exit(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user