diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-08-03 01:02:46 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-08-03 01:04:29 +0300 |
commit | 3b698f40dfac7986df74cf451438593e0aaeab08 (patch) | |
tree | e0b559009d9cbe9c0d2c6dcc2b554adba4712766 /meson_test.py | |
parent | f5f2ddde7e4a63ed9cc9eef0214f95c26c24c6da (diff) | |
download | meson-3b698f40dfac7986df74cf451438593e0aaeab08.zip meson-3b698f40dfac7986df74cf451438593e0aaeab08.tar.gz meson-3b698f40dfac7986df74cf451438593e0aaeab08.tar.bz2 |
Print test name rather than the path to executable.
Diffstat (limited to 'meson_test.py')
-rwxr-xr-x | meson_test.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/meson_test.py b/meson_test.py index dd6f5c2..f8da08e 100755 --- a/meson_test.py +++ b/meson_test.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys, subprocess, time, datetime +import sys, subprocess, time, datetime, pickle from optparse import OptionParser parser = OptionParser() @@ -39,11 +39,11 @@ def run_tests(options, datafilename): logfilename = logfile_base + '-' + options.wrapper.replace(' ', '_') + '.txt' logfile = open(logfilename, 'w') logfile.write('Log of Meson test suite run on %s.\n\n' % datetime.datetime.now().isoformat()) - for line in open(datafilename, 'r'): - line = line.strip() - if line == '': - continue - cmd = wrap + [line] + tests = pickle.load(open(datafilename, 'rb')) + for test in tests: + name = test[0] + fname = test[1] + cmd = wrap + [fname] starttime = time.time() p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdo, stde) = p.communicate() @@ -53,11 +53,11 @@ def run_tests(options, datafilename): stde = stde.decode() if p.returncode != 0: - result_str = 'Test "%s": FAIL (%.3f s)' % (line, duration) + result_str = 'Test "%s": FAIL (%.3f s)' % (name, duration) else: - result_str = 'Test "%s": OK (%.3f s)' % (line, duration) + result_str = 'Test "%s": OK (%.3f s)' % (name, duration) print(result_str) - write_log(logfile, line, result_str, stdo, stde) + write_log(logfile, name, result_str, stdo, stde) print('\nFull log written to %s.' % logfilename) if __name__ == '__main__': |