diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-09-29 23:17:02 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-10-01 22:02:51 +0300 |
commit | d3b389f349edf9fac12c3d40361ea0cd394926c0 (patch) | |
tree | d3f5b8947ae0795cbf48128a23cad47961514fb8 /run_unittests.py | |
parent | 5a52983f16309b86d7be1a327e2f240be2bcaaea (diff) | |
download | meson-d3b389f349edf9fac12c3d40361ea0cd394926c0.zip meson-d3b389f349edf9fac12c3d40361ea0cd394926c0.tar.gz meson-d3b389f349edf9fac12c3d40361ea0cd394926c0.tar.bz2 |
Add clang-tidy target. Closes #2383.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index a2b083f..2df8bcb 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3659,6 +3659,19 @@ recommended as it is not supported on some platforms''') if os.path.exists(testheader): os.unlink(testheader) + @skipIfNoExecutable('clang-tidy') + def test_clang_tidy(self): + if self.backend is not Backend.ninja: + raise unittest.SkipTest('Clang-tidy is for now only supported on Ninja, not {}'.format(self.backend.name)) + if shutil.which('c++') is None: + raise unittest.SkipTest('Clang-tidy breaks when ccache is used and "c++" not in path.') + if is_osx(): + raise unittest.SkipTest('Apple ships a broken clang-tidy that chokes on -pipe.') + testdir = os.path.join(self.unit_test_dir, '70 clang-tidy') + self.init(testdir, override_envvars={'CXX': 'c++'}) + out = self.run_target('clang-tidy') + self.assertIn('cttest.cpp:4:20', out) + def test_introspect_buildoptions_without_configured_build(self): testdir = os.path.join(self.unit_test_dir, '59 introspect buildoptions') testfile = os.path.join(testdir, 'meson.build') |