Merge #10187: tests: Fix test_runner return value in case of skipped test

e96462f tests: Fix test_runner return value in case of skipped test (Wladimir J. van der Laan)

Tree-SHA512: 99434ce3e0b5376268d33cdbae46d48786feb9820c7f8acccdd50f6674e315abffc84ba1feda441332d140a7480070eba732abae8f07293984d4daa9352ee8ee
This commit is contained in:
MarcoFalke 2017-04-12 00:57:20 +02:00 committed by Pasta
parent 5e796e95fd
commit 6b9e864a08
No known key found for this signature in database
GPG Key ID: D362C9F7142766AE

View File

@ -318,7 +318,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal
logging.debug("Cleaning up coverage data") logging.debug("Cleaning up coverage data")
coverage.cleanup() 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) sys.exit(not all_passed)
@ -330,7 +330,7 @@ def print_results(test_results, max_len_name, runtime):
time_sum = 0 time_sum = 0
for test_result in test_results: 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 time_sum += test_result.time
test_result.padding = max_len_name test_result.padding = max_len_name
results += str(test_result) results += str(test_result)
@ -418,6 +418,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] 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): def check_script_list(src_dir):
"""Check scripts directory. """Check scripts directory.