diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-05 15:59:47 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-05 17:17:09 +0200 |
commit | c96557c9ed790ebe3c6205d143b7f8c75875236f (patch) | |
tree | 7cbd7ba0f7da11d1efae810b19a5d928f2056c42 /run_project_tests.py | |
parent | 11968382a3800f7dd6d04b3a94d4351f0950dd9a (diff) | |
download | meson-c96557c9ed790ebe3c6205d143b7f8c75875236f.zip meson-c96557c9ed790ebe3c6205d143b7f8c75875236f.tar.gz meson-c96557c9ed790ebe3c6205d143b7f8c75875236f.tar.bz2 |
Store and print test logs of executed projects.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 9bba632..1abc199 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -283,14 +283,19 @@ def run_test_inprocess(testdir): sys.stderr = mystderr = StringIO() old_cwd = os.getcwd() os.chdir(testdir) + test_log_fname = 'meson-logs/testlog.txt' try: returncode_test = mesontest.run(['--no-rebuild']) + if os.path.exists(test_log_fname): + test_log = open(test_log_fname, errors='ignore').read() + else: + test_log = '' returncode_benchmark = mesontest.run(['--no-rebuild', '--benchmark', '--logbase', 'benchmarklog']) finally: sys.stdout = old_stdout sys.stderr = old_stderr os.chdir(old_cwd) - return max(returncode_test, returncode_benchmark), mystdout.getvalue(), mystderr.getvalue() + return max(returncode_test, returncode_benchmark), mystdout.getvalue(), mystderr.getvalue(), test_log def parse_test_args(testdir): args = [] @@ -357,10 +362,11 @@ def _run_test(testdir, test_build_dir, install_dir, extra_args, compiler, backen os.utime(os.path.join(testdir, 'meson.build')) test_start = time.time() # Test in-process - (returncode, tstdo, tstde) = run_test_inprocess(test_build_dir) + (returncode, tstdo, tstde, test_log) = run_test_inprocess(test_build_dir) test_time = time.time() - test_start stdo += tstdo stde += tstde + mesonlog += test_log if should_fail == 'test': if returncode != 0: return TestResult('', BuildStep.test, stdo, stde, mesonlog, gen_time) |