Skip to content

Commit 2c71e67

Browse files
author
H. Peter Anvin (Intel)
committed
travis: don't stop on failure
Don't stop travis after a single test failure. It is better to run all the tests and get a comprehensive list of failing tests. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1 parent c0aec69 commit 2c71e67

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ $(travis_version): version
579579
printf 'NASM version %s compiled on ?\n' `cat version` > $@
580580

581581
travis: $(PROGS) $(travis_version)
582-
-$(PYTHON3) travis/nasm-t.py run > travis.log
582+
-$(PYTHON3) travis/nasm-t.py run --stop=n > travis.log
583583
@if $(GREP) FAIL travis.log; then exit 1; else \
584584
echo '=== All tests PASS ==='; fi
585585

travis/nasm-t.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
dest = 'test',
3030
help = 'Run the selected test only',
3131
required = False)
32+
spp.add_argument('--stop',
33+
dest = 'stop', default = 'y',
34+
help = 'Stop immediately on failure (default "y")',
35+
required = False)
3236

3337
for cmd in ['new']:
3438
spp = sp.add_parser(cmd, help = 'Add a new test case')
@@ -109,7 +113,7 @@
109113

110114
if args.cmd == None:
111115
parser.print_help()
112-
sys.exit(1)
116+
sys.exit(64)
113117

114118
def read_stdfile(path):
115119
with open(path, "rb") as f:
@@ -232,7 +236,7 @@ def collect_test_desc_from_dir(basedir):
232236
def test_abort(test, message):
233237
print("\t%s: %s" % (test, message))
234238
print("=== Test %s ABORT ===" % (test))
235-
sys.exit(1)
239+
sys.exit(2)
236240
return False
237241

238242
def test_fail(test, message):
@@ -556,6 +560,7 @@ def test_update(desc):
556560
f.close()
557561

558562
if args.cmd == 'run':
563+
errors = 0
559564
desc_array = []
560565
if args.test == None:
561566
desc_array = collect_test_desc_from_dir(args.dir)
@@ -566,10 +571,14 @@ def test_update(desc):
566571

567572
for desc in desc_array:
568573
if test_run(desc) == False:
574+
errors = 1;
569575
if 'error' in desc and desc['error'] == 'over':
570576
test_over(desc['_test-name'])
571577
else:
572-
test_abort(desc['_test-name'], "Error detected")
578+
errors = 1
579+
if args.stop == 'y':
580+
test_abort(desc['_test-name'], "Error detected")
581+
sys.exit(errors)
573582

574583
if args.cmd == 'update':
575584
desc_array = []

0 commit comments

Comments
 (0)