aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorAleksey Filippov <alekseyf@google.com>2018-03-21 01:20:58 +0000
committerAleksey Filippov <alekseyf@google.com>2018-03-21 16:42:35 +0000
commitaf0b569ced2bc3d0eb8d30bf4bc26cdee975ea60 (patch)
treecee41a140ed82e93eff40a6544db9a9093966499 /run_unittests.py
parent39a3bdb43f66c61f9ff93b7bb947cb772948dbf3 (diff)
downloadmeson-af0b569ced2bc3d0eb8d30bf4bc26cdee975ea60.zip
meson-af0b569ced2bc3d0eb8d30bf4bc26cdee975ea60.tar.gz
meson-af0b569ced2bc3d0eb8d30bf4bc26cdee975ea60.tar.bz2
Add unittests for b_ndebug=if-release and buildtype interactions
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index b6367c1..94e39c8 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1895,6 +1895,20 @@ int main(int argc, char **argv) {
exception_raised = True
self.assertTrue(exception_raised, 'Double locking did not raise exception.')
+ def test_ndebug_if_release_disabled(self):
+ testdir = os.path.join(self.unit_test_dir, '25 ndebug if-release')
+ self.init(testdir, extra_args=['--buildtype=release', '-Db_ndebug=if-release'])
+ self.build()
+ exe = os.path.join(self.builddir, 'main')
+ self.assertEqual(b'NDEBUG=1', subprocess.check_output(exe).strip())
+
+ def test_ndebug_if_release_enabled(self):
+ testdir = os.path.join(self.unit_test_dir, '25 ndebug if-release')
+ self.init(testdir, extra_args=['--buildtype=debugoptimized', '-Db_ndebug=if-release'])
+ self.build()
+ exe = os.path.join(self.builddir, 'main')
+ self.assertEqual(b'NDEBUG=0', subprocess.check_output(exe).strip())
+
class FailureTests(BasePlatformTests):
'''