diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-08-03 01:18:33 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-08-03 01:18:33 +0300 |
commit | fba84a46a1ca5daf43a2db517116ada3ffaa8557 (patch) | |
tree | d5f22708bc2f7a94a5f1575d56aa76d27e4fd128 /meson_test.py | |
parent | 3b698f40dfac7986df74cf451438593e0aaeab08 (diff) | |
download | meson-fba84a46a1ca5daf43a2db517116ada3ffaa8557.zip meson-fba84a46a1ca5daf43a2db517116ada3ffaa8557.tar.gz meson-fba84a46a1ca5daf43a2db517116ada3ffaa8557.tar.bz2 |
Prettyified test runner output.
Diffstat (limited to 'meson_test.py')
-rwxr-xr-x | meson_test.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/meson_test.py b/meson_test.py index f8da08e..b0864ec 100755 --- a/meson_test.py +++ b/meson_test.py @@ -40,7 +40,7 @@ def run_tests(options, datafilename): logfile = open(logfilename, 'w') logfile.write('Log of Meson test suite run on %s.\n\n' % datetime.datetime.now().isoformat()) tests = pickle.load(open(datafilename, 'rb')) - for test in tests: + for i, test in enumerate(tests): name = test[0] fname = test[1] cmd = wrap + [fname] @@ -52,10 +52,14 @@ def run_tests(options, datafilename): stdo = stdo.decode() stde = stde.decode() - if p.returncode != 0: - result_str = 'Test "%s": FAIL (%.3f s)' % (name, duration) + num = '%d/%d' % (i+1, len(tests)) + padding1 = ' '*(40-len(name)) + if p.returncode == 0: + res = 'OK' else: - result_str = 'Test "%s": OK (%.3f s)' % (name, duration) + res = 'FAIL' + padding2 = ' '*(5-len(res)) + result_str = '%s "%s"%s%s%s(%.3f s)' % (num, name, padding1, res, padding2, duration) print(result_str) write_log(logfile, name, result_str, stdo, stde) print('\nFull log written to %s.' % logfilename) |