run_wml_tests: Ensure the name of a failing test is included in the output

Previously, the runner relied on the name being part of the output log from the Wesnoth process.
This works in most cases because Wesnoth prints a line with the test's name before exiting.
However, if the test timed out, that line would typically be missing, so this makes the runner insert it into the failure message as well to make sure it's present.
This commit is contained in:
Celtic Minstrel 2021-04-15 00:07:53 -04:00
parent 99384b038c
commit 1285060bc4

View file

@ -213,7 +213,7 @@ class WesnothRunner:
if expected_result == UnitTestResult.PASS and line.startswith("PASS TEST"):
continue
print(line)
print("Failure, Wesnoth returned", returned_result, "but we expected", expected_result)
print("Failure, Wesnoth returned", returned_result, "for", test_list[num_passed - 1].name, "but we expected", expected_result)
test_summary.fail_test()
test_summary.skip_test(len(test_list) - num_passed - 1)
raise UnexpectedTestStatusException()