From a51d582c725ee39e9f0308e03e20179afd16178a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 8 Apr 2017 09:18:57 +0530 Subject: [PATCH] unit tests: Skip tests that need Ninja Such as tests that use the compiler db, or install things. --- run_unittests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/run_unittests.py b/run_unittests.py index 0c7d6c09f..648579708 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -405,6 +405,8 @@ class BasePlatformTests(unittest.TestCase): self._run(self.test_command, workdir=self.builddir) def install(self): + if self.backend is not Backend.ninja: + raise unittest.SkipTest('{!r} backend can\'t install files'.format(self.backend.name)) os.environ['DESTDIR'] = self.installdir self._run(self.install_command, workdir=self.builddir) @@ -430,6 +432,8 @@ class BasePlatformTests(unittest.TestCase): shutil.rmtree(self.builddir) def get_compdb(self): + if self.backend is not Backend.ninja: + raise unittest.SkipTest('Compiler db not available with {} backend'.format(self.backend.name)) with open(os.path.join(self.builddir, 'compile_commands.json')) as ifile: contents = json.load(ifile) # If Ninja is using .rsp files, generate them, read their contents, and @@ -611,6 +615,8 @@ class AllPlatformTests(BasePlatformTests): Tests that the Meson introspection API exposes install filenames correctly https://github.com/mesonbuild/meson/issues/829 ''' + if self.backend is not Backend.ninja: + raise unittest.SkipTest('{!r} backend can\'t install files'.format(self.backend.name)) testdir = os.path.join(self.common_test_dir, '8 install') self.init(testdir) intro = self.introspect('--targets')