Skip to content

Commit

Permalink
run_wml_tests: Output symbolic forms of unit test results in addition…
Browse files Browse the repository at this point in the history
… to the numeric return code
  • Loading branch information
CelticMinstrel committed Mar 14, 2021
1 parent 7b7b904 commit 5337973
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions run_wml_tests
Expand Up @@ -21,6 +21,9 @@ class UnitTestResult(enum.Enum):
FAIL_WML_EXCEPTION = 6
FAIL_BY_DEFEAT = 7
PASS_BY_VICTORY = 8

def __str__(self):
return str(self.value) + ' ' + self.name

class TestCase:
"""Represents a single line of the wml_test_schedule."""
Expand Down Expand Up @@ -166,11 +169,12 @@ class WesnothRunner:
gdb_args.extend(args)
subprocess.run(gdb_args, timeout=240)
raise UnexpectedTestStatusException()
if res.returncode != expected_result.value:
returned_result = UnitTestResult(res.returncode)
if returned_result != expected_result:
with open(get_output_filename(args), "r") as output:
for line in output.readlines():
print(line)
print("Failure, Wesnoth returned", res.returncode, "but we expected", expected_result.value)
print("Failure, Wesnoth returned", returned_result, "but we expected", expected_result)
raise UnexpectedTestStatusException()

def test_batcher(test_list):
Expand Down

0 comments on commit 5337973

Please sign in to comment.