aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-05-26 00:10:32 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-06 07:53:10 +0000
commit0565262be35423b60a69b5df32c4ca485e976b12 (patch)
tree8413d7a49175d5dde389b62b91763c4cf8cd7574 /run_unittests.py
parent3e1a610702adfec51a24a7dfdcba8a0319a795a1 (diff)
downloadmeson-0565262be35423b60a69b5df32c4ca485e976b12.zip
meson-0565262be35423b60a69b5df32c4ca485e976b12.tar.gz
meson-0565262be35423b60a69b5df32c4ca485e976b12.tar.bz2
Add documentation for Builtin options and bitcode
Also add a test that ensures that new base options and compiler options are always documented.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index a25ba34..ca8bc62 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2113,6 +2113,27 @@ recommended as it can lead to undefined behaviour on some platforms''')
self.assertEqual(obj.builtins['default_library'].value, 'shared')
self.wipe()
+ def test_compiler_options_documented(self):
+ '''
+ Test that C and C++ compiler options and base options are documented in
+ Builtin-Options.md. Only tests the default compiler for the current
+ platform on the CI.
+ '''
+ md = None
+ with open('docs/markdown/Builtin-options.md') as f:
+ md = f.read()
+ self.assertIsNotNone(md)
+ env = Environment('.', self.builddir, get_fake_options(self.prefix), [])
+ # FIXME: Support other compilers
+ cc = env.detect_c_compiler(False)
+ cpp = env.detect_cpp_compiler(False)
+ for comp in (cc, cpp):
+ for opt in comp.get_options().keys():
+ self.assertIn(opt, md)
+ for opt in comp.base_options:
+ self.assertIn(opt, md)
+ self.assertNotIn('b_unknown', md)
+
class FailureTests(BasePlatformTests):
'''