aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 582d6f5..4cfb743 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2206,6 +2206,7 @@ recommended as it is not supported on some platforms''')
# they used to fail this test with Meson 0.46 an earlier versions.
pass
+ @unittest.skipIf(not os.path.isdir('docs'), 'Doc dir not found, presumably because this is a tarball release.')
def test_compiler_options_documented(self):
'''
Test that C and C++ compiler options and base options are documented in
@@ -2227,6 +2228,24 @@ recommended as it is not supported on some platforms''')
self.assertIn(opt, md)
self.assertNotIn('b_unknown', md)
+ @unittest.skipIf(not os.path.isdir('docs'), 'Doc dir not found, presumably because this is a tarball release.')
+ def test_cpu_families_documented(self):
+ with open("docs/markdown/Reference-tables.md") as f:
+ md = f.read()
+ self.assertIsNotNone(md)
+
+ sections = list(re.finditer(r"^## (.+)$", md, re.MULTILINE))
+ for s1, s2 in zip(sections[::2], sections[1::2]):
+ if s1.group(1) == "CPU families":
+ # Extract the content for this section
+ content = md[s1.end():s2.start()]
+ # Find the list entries
+ arches = [m.group(1) for m in re.finditer(r"^\| (\w+) +\|", content, re.MULTILINE)]
+ # Drop the header
+ arches = set(arches[1:])
+ self.assertEqual(arches, set(mesonbuild.environment.known_cpu_families))
+
+
class FailureTests(BasePlatformTests):
'''
Tests that test failure conditions. Build files here should be dynamically