diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-09-02 00:36:26 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-10-01 21:12:04 +0300 |
commit | 5b422fce87826beff3bca85e9c9081f22b3f45b7 (patch) | |
tree | f60521dd35db02ae264f4b0031ac26b8487d59d4 /run_unittests.py | |
parent | 7d9e58f12568de16625c6f063e1e8c50920a012e (diff) | |
download | meson-5b422fce87826beff3bca85e9c9081f22b3f45b7.zip meson-5b422fce87826beff3bca85e9c9081f22b3f45b7.tar.gz meson-5b422fce87826beff3bca85e9c9081f22b3f45b7.tar.bz2 |
Make Python 2 tests optional(er) to prepare for py2 purge in Debian.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index a2b083f..9dedbbe 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -6328,6 +6328,15 @@ class NativeFileTests(BasePlatformTests): # python module breaks. This is fine on other OSes because they # don't need the extra indirection. raise unittest.SkipTest('bat indirection breaks internal sanity checks.') + if os.path.exists('/etc/debian_version'): + rc = subprocess.call(['pkg-config', '--cflags', 'python2'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + if rc != 0: + # Python 2 will be removed in Debian Bullseye, thus we must + # remove the build dependency on python2-dev. Keep the tests + # but only run them if dev packages are available. + raise unittest.SkipTest('Not running Python 2 tests because dev packages not installed.') self._simple_test('python', 'python') @unittest.skipIf(is_windows(), 'Setting up multiple compilers on windows is hard') |