aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
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 9391eae..0e3b7d5 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -43,6 +43,7 @@ class LinuxlikeTests(unittest.TestCase):
self.builddir = tempfile.mkdtemp()
self.meson_command = [sys.executable, os.path.join(src_root, 'meson.py')]
self.mconf_command = [sys.executable, os.path.join(src_root, 'mesonconf.py')]
+ self.mintro_command = [sys.executable, os.path.join(src_root, 'mesonintrospect.py')]
self.ninja_command = [detect_ninja(), '-C', self.builddir]
self.common_test_dir = os.path.join(src_root, 'test cases/common')
self.vala_test_dir = os.path.join(src_root, 'test cases/vala')
@@ -67,6 +68,10 @@ class LinuxlikeTests(unittest.TestCase):
with open(os.path.join(self.builddir, 'compile_commands.json')) as ifile:
return json.load(ifile)
+ def introspect(self, arg):
+ out = subprocess.check_output(self.mintro_command + [arg, self.builddir])
+ return json.loads(out.decode('utf-8'))
+
def test_basic_soname(self):
testdir = os.path.join(self.common_test_dir, '4 shared')
self.init(testdir)
@@ -147,5 +152,14 @@ class LinuxlikeTests(unittest.TestCase):
self.assertTrue(compdb[3]['file'].endswith("libfile4.c"))
# FIXME: We don't have access to the linker command
+ def test_install_introspection(self):
+ testdir = os.path.join(self.common_test_dir, '8 install')
+ self.init(testdir)
+ intro = self.introspect('--targets')
+ if intro[0]['type'] == 'executable':
+ intro = intro[::-1]
+ self.assertEqual(intro[0]['install_filename'], '/usr/local/libtest/libstat.a')
+ self.assertEqual(intro[1]['install_filename'], '/usr/local/bin/prog')
+
if __name__ == '__main__':
unittest.main()