diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-04-11 19:40:54 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-04-11 19:49:34 +0200 |
commit | e96462fbece87448619ba23f4917de2bfc257ee6 (patch) | |
tree | 44f50495541c4eea63d69559d0ca1c7e17355437 | |
parent | 67023e9004ba843218bee16bc821e955faf0d394 (diff) |
tests: Fix test_runner return value in case of skipped test
Currently test_runner reports an error if a test case is skipped.
This is not how it should be, only failed tests should cause it to fail.
-rwxr-xr-x | test/functional/test_runner.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index c0bbc623a8..bb12328ec1 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -293,7 +293,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal logging.debug("Cleaning up coverage data") coverage.cleanup() - all_passed = all(map(lambda test_result: test_result.status == "Passed", test_results)) + all_passed = all(map(lambda test_result: test_result.was_successful, test_results)) sys.exit(not all_passed) @@ -305,7 +305,7 @@ def print_results(test_results, max_len_name, runtime): time_sum = 0 for test_result in test_results: - all_passed = all_passed and test_result.status != "Failed" + all_passed = all_passed and test_result.was_successful time_sum += test_result.time test_result.padding = max_len_name results += str(test_result) @@ -393,6 +393,10 @@ class TestResult(): return color[1] + "%s | %s%s | %s s\n" % (self.name.ljust(self.padding), glyph, self.status.ljust(7), self.time) + color[0] + @property + def was_successful(self): + return self.status != "Failed" + def check_script_list(src_dir): """Check scripts directory. |