Skip to content

Commit

Permalink
test: report timeout as failure
Browse files Browse the repository at this point in the history
  • Loading branch information
berteauxjb authored and dcbaker committed Oct 31, 2024
1 parent 8242187 commit a337dfe
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion mesonbuild/mtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def log(self, harness: 'TestHarness', test: 'TestRun') -> None:
et.SubElement(testcase, 'failure')
elif subtest.result is TestResult.UNEXPECTEDPASS:
fail = et.SubElement(testcase, 'failure')
fail.text = 'Test unexpected passed.'
fail.text = 'Test unexpectedly passed.'
elif subtest.result is TestResult.INTERRUPT:
fail = et.SubElement(testcase, 'error')
fail.text = 'Test was interrupted by user.'
Expand Down Expand Up @@ -891,6 +891,18 @@ def log(self, harness: 'TestHarness', test: 'TestRun') -> None:
elif test.res is TestResult.FAIL:
et.SubElement(testcase, 'failure')
suite.attrib['failures'] = str(int(suite.attrib['failures']) + 1)
elif test.res is TestResult.UNEXPECTEDPASS:
fail = et.SubElement(testcase, 'failure')
fail.text = 'Test unexpectedly passed.'
suite.attrib['failures'] = str(int(suite.attrib['failures']) + 1)
elif test.res is TestResult.INTERRUPT:
fail = et.SubElement(testcase, 'error')
fail.text = 'Test was interrupted by user.'
suite.attrib['errors'] = str(int(suite.attrib['errors']) + 1)
elif test.res is TestResult.TIMEOUT:
fail = et.SubElement(testcase, 'error')
fail.text = 'Test did not finish before configured timeout.'
suite.attrib['errors'] = str(int(suite.attrib['errors']) + 1)
if test.stdo:
out = et.SubElement(testcase, 'system-out')
out.text = replace_unencodable_xml_chars(test.stdo.rstrip())
Expand Down

0 comments on commit a337dfe

Please sign in to comment.