aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 831e53f..da898a3 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -4617,6 +4617,31 @@ recommended as it is not supported on some platforms''')
out = self.build()
self.assertNotIn('Project configured', out)
+ def _test_junit(self, case: str) -> None:
+ try:
+ import lxml.etree as et
+ except ImportError:
+ raise unittest.SkipTest('lxml required, but not found.')
+
+ schema = et.XMLSchema(et.parse(str(Path(__file__).parent / 'data' / 'schema.xsd')))
+
+ testdir = os.path.join(self.common_test_dir, case)
+ self.init(testdir)
+ self.run_tests()
+
+ junit = et.parse(str(Path(self.builddir) / 'meson-logs' / 'testlog.junit.xml'))
+ try:
+ schema.assertValid(junit)
+ except et.DocumentInvalid as e:
+ self.fail(e.error_log)
+
+ def test_junit_valid_tap(self):
+ self._test_junit('213 tap tests')
+
+ def test_junit_valid_exitcode(self):
+ self._test_junit('44 test args')
+
+
class FailureTests(BasePlatformTests):
'''
Tests that test failure conditions. Build files here should be dynamically