From a337dfe2650824c98683d71a91a577706c3e0e62 Mon Sep 17 00:00:00 2001 From: Jean-Bernard Berteaux Date: Wed, 16 Oct 2024 09:27:38 +0200 Subject: [PATCH] test: report timeout as failure --- mesonbuild/mtest.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index c417bc0b38b7..503cb14325dd 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -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.' @@ -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())