aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-10-01 22:03:43 +0300
committerGitHub <noreply@github.com>2019-10-01 22:03:43 +0300
commit48a5d17830820e4729d252fc33c26fb9dac66404 (patch)
tree9240fda2a4ad1cf178b75c16f6171e8d4d010427 /run_unittests.py
parentd3b389f349edf9fac12c3d40361ea0cd394926c0 (diff)
parent94564b8f1a073a157f5698bf49cdea075dacc790 (diff)
downloadmeson-48a5d17830820e4729d252fc33c26fb9dac66404.zip
meson-48a5d17830820e4729d252fc33c26fb9dac66404.tar.gz
meson-48a5d17830820e4729d252fc33c26fb9dac66404.tar.bz2
Merge pull request #5873 from mesonbuild/py2optional
Make Python 2 tests optional(er) to prepare for py2 purge in Debian.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 2df8bcb..d6c81a1 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -6341,6 +6341,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')