diff options
author | Aleksey Filippov <alekseyf@google.com> | 2018-03-28 17:13:29 +0000 |
---|---|---|
committer | Aleksey Filippov <alekseyf@google.com> | 2018-03-28 18:34:02 +0000 |
commit | 9c01fc0e49665c13f4f262fe5d456e4b133d3634 (patch) | |
tree | 8a3178e9ab89bdf7b1d73e966d3d535347dabadc | |
parent | 2aa1c3d575e10054c7dee0a33742aa8b23578bca (diff) | |
download | meson-9c01fc0e49665c13f4f262fe5d456e4b133d3634.zip meson-9c01fc0e49665c13f4f262fe5d456e4b133d3634.tar.gz meson-9c01fc0e49665c13f4f262fe5d456e4b133d3634.tar.bz2 |
Do not access counters from parallel code
-rw-r--r-- | mesonbuild/mtest.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 91c4121..61f7823 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -366,22 +366,30 @@ class TestHarness: stde = decode(stde) if timed_out: res = TestResult.TIMEOUT - self.timeout_count += 1 - self.fail_count += 1 elif p.returncode == GNU_SKIP_RETURNCODE: res = TestResult.SKIP - self.skip_count += 1 elif test.should_fail == bool(p.returncode): res = TestResult.OK - self.success_count += 1 else: res = TestResult.FAIL - self.fail_count += 1 returncode = p.returncode result = TestRun(res, returncode, test.should_fail, duration, stdo, stde, cmd, test.env) return result + def process_test_result(self, result): + if result.res is TestResult.TIMEOUT: + self.timeout_count += 1 + self.fail_count += 1 + elif result.res is TestResult.SKIP: + self.skip_count += 1 + elif result.res is TestResult.OK: + self.success_count += 1 + elif result.res is TestResult.FAIL: + self.fail_count += 1 + else: + sys.exit('Unknown test result encountered: {}'.format(result.res)) + def print_stats(self, numlen, tests, name, result, i): startpad = ' ' * (numlen - len('%d' % (i + 1))) num = '%s%d/%d' % (startpad, i + 1, len(tests)) @@ -568,6 +576,7 @@ TIMEOUT: %4d futures = [] test_env, test_opts = self.get_test_env(test) res = self.run_single_test(test, test_env, test_opts) + self.process_test_result(res) self.print_stats(numlen, tests, visible_name, res, i) else: if not executor: @@ -596,6 +605,7 @@ TIMEOUT: %4d result.cancel() if self.options.verbose: result.result() + self.process_test_result(result.result()) self.print_stats(numlen, tests, name, result.result(), i) def run_special(self): |