diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-16 14:06:26 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-18 00:33:08 +0200 |
commit | db34a3a7017d0096faa8d3f020efd078ad8a65e1 (patch) | |
tree | ec262cbf17ca153307e0b1c6fbbc0104af478a9e /run_project_tests.py | |
parent | 5eb64a6f3e47b570f544524ef48dc6ef0e4dce59 (diff) | |
download | meson-db34a3a7017d0096faa8d3f020efd078ad8a65e1.zip meson-db34a3a7017d0096faa8d3f020efd078ad8a65e1.tar.gz meson-db34a3a7017d0096faa8d3f020efd078ad8a65e1.tar.bz2 |
Close files reliably.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 5994c5a..3420946 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -463,10 +463,15 @@ def detect_tests_to_run(): return gathered_tests def run_tests(all_tests, log_name_base, extra_args): - global stop, executor, futures + global logfile txtname = log_name_base + '.txt' + with open(txtname, 'w', encoding="utf_8") as lf: + logfile = lf + return _run_tests(all_tests, log_name_base, extra_args) + +def _run_tests(all_tests, log_name_base, extra_args): + global stop, executor, futures xmlname = log_name_base + '.xml' - logfile = open(txtname, 'w', encoding="utf_8") junit_root = ET.Element('testsuites') conf_time = 0 build_time = 0 |