aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-03-13 14:13:21 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2017-04-15 18:28:36 +0300
commitb48daeda1a53f0a1a218492e356186846a3abfff (patch)
tree66dd497fbd88c5c2991d19601058f4f8639c64b1 /run_unittests.py
parent4e1249c920a6f64e2ca953334e9ec700f30693da (diff)
downloadmeson-b48daeda1a53f0a1a218492e356186846a3abfff.zip
meson-b48daeda1a53f0a1a218492e356186846a3abfff.tar.gz
meson-b48daeda1a53f0a1a218492e356186846a3abfff.tar.bz2
Make it possible to only do unity builds on subprojects.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 7bdd57b..e8ecbb2 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -390,8 +390,11 @@ class BasePlatformTests(unittest.TestCase):
return output
def init(self, srcdir, extra_args=None, default_args=True):
+ self.assertTrue(os.path.exists(srcdir))
if extra_args is None:
extra_args = []
+ if not isinstance(extra_args, list):
+ extra_args = [extra_args]
args = [srcdir, self.builddir]
if default_args:
args += ['--prefix', self.prefix,
@@ -1374,6 +1377,14 @@ class LinuxlikeTests(BasePlatformTests):
cpp = env.detect_cpp_compiler(False)
self._test_stds_impl(testdir, cpp, 'cpp')
+ def test_unity_subproj(self):
+ testdir = os.path.join(self.common_test_dir, '49 subproject')
+ self.init(testdir, extra_args='--unity=subprojects')
+ self.assertTrue(os.path.exists(os.path.join(self.builddir, 'subprojects/sublib/simpletest@exe/simpletest-unity.c')))
+ self.assertTrue(os.path.exists(os.path.join(self.builddir, 'subprojects/sublib/sublib@sha/sublib-unity.c')))
+ self.assertFalse(os.path.exists(os.path.join(self.builddir, 'user@exe/user-unity.c')))
+ self.build()
+
def test_installed_modes(self):
'''
Test that files installed by these tests have the correct permissions.