Skip to content

Commit e96462f

Browse files
committed
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.
1 parent 67023e9 commit e96462f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/functional/test_runner.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal
293293
logging.debug("Cleaning up coverage data")
294294
coverage.cleanup()
295295

296-
all_passed = all(map(lambda test_result: test_result.status == "Passed", test_results))
296+
all_passed = all(map(lambda test_result: test_result.was_successful, test_results))
297297

298298
sys.exit(not all_passed)
299299

@@ -305,7 +305,7 @@ def print_results(test_results, max_len_name, runtime):
305305
time_sum = 0
306306

307307
for test_result in test_results:
308-
all_passed = all_passed and test_result.status != "Failed"
308+
all_passed = all_passed and test_result.was_successful
309309
time_sum += test_result.time
310310
test_result.padding = max_len_name
311311
results += str(test_result)
@@ -393,6 +393,10 @@ def __repr__(self):
393393

394394
return color[1] + "%s | %s%s | %s s\n" % (self.name.ljust(self.padding), glyph, self.status.ljust(7), self.time) + color[0]
395395

396+
@property
397+
def was_successful(self):
398+
return self.status != "Failed"
399+
396400

397401
def check_script_list(src_dir):
398402
"""Check scripts directory.

0 commit comments

Comments
 (0)