Bug 510730: make new trace-test harness output tinderbox-parseable, r=graydon

--HG--
extra : rebase_source : de6ca79b0df5b8d98e24f2fe6cd5ebd4f16c5964
This commit is contained in:
David Mandelin 2009-08-17 16:53:41 -07:00
Родитель 5e7453dfaa
Коммит 6edf99f2c8
2 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -344,7 +344,7 @@ endif
ifdef ENABLE_JIT
check::
$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) $(srcdir)/trace-test/trace-test.py \
-x slow $(DIST)/bin/js$(BIN_SUFFIX)
-x slow --no-progress --tinderbox $(DIST)/bin/js$(BIN_SUFFIX)
endif
DIST_GARBAGE = config.cache config.log config.status \

Просмотреть файл

@ -53,7 +53,7 @@ def run_test(path, lib_dir):
if OPTIONS.show_output:
sys.stdout.write(out)
sys.stdout.write(err)
return check_output(out, err, p.returncode)
return (check_output(out, err, p.returncode), out, err)
assert_re = re.compile(r'Assertion failed:')
stat_re = re.compile(r'^Trace stats check failed')
@ -85,9 +85,23 @@ def run_tests(tests, lib_dir):
complete = False
try:
for i, test in enumerate(tests):
if not run_test(test, lib_dir):
ok, out, err = run_test(test, lib_dir)
if not ok:
failures.append(test)
if OPTIONS.tinderbox:
if ok:
print('TEST-PASS | trace-test.py | %s'%test)
else:
lines = [ _ for _ in out.split('\n') + err.split('\n')
if _ != '' ]
if len(lines) >= 1:
msg = lines[-1]
else:
msg = ''
print('TEST-UNEXPECTED-FAIL | trace-test.py | %s: %s'%
(test, msg))
n = i + 1
if pb:
pb.label = '[%3d|%3d|%3d]'%(n - len(failures), len(failures), n)
@ -130,6 +144,8 @@ if __name__ == '__main__':
help='exclude given test dir or path')
op.add_option('--no-progress', dest='hide_progress', action='store_true',
help='hide progress bar')
op.add_option('--tinderbox', dest='tinderbox', action='store_true',
help='Tinderbox-parseable output format')
(OPTIONS, args) = op.parse_args()
if len(args) < 1:
op.error('missing JS_SHELL argument')