diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2022-04-11 21:05:20 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-04-13 21:27:22 +0300 |
commit | 2fcd3a417489ca456b57f87c9921f68d5872bb3a (patch) | |
tree | ae63b85dbde55a63a42cee6bd7162b0d2c43c3c0 /unittests/pythontests.py | |
parent | a0e7f934148e35ce309ce998028e21f6df66e5cf (diff) | |
download | meson-2fcd3a417489ca456b57f87c9921f68d5872bb3a.zip meson-2fcd3a417489ca456b57f87c9921f68d5872bb3a.tar.gz meson-2fcd3a417489ca456b57f87c9921f68d5872bb3a.tar.bz2 |
Add regression test for Python dist.
Diffstat (limited to 'unittests/pythontests.py')
-rw-r--r-- | unittests/pythontests.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unittests/pythontests.py b/unittests/pythontests.py index 27716d7..d49107f 100644 --- a/unittests/pythontests.py +++ b/unittests/pythontests.py @@ -14,12 +14,17 @@ import os import unittest +import pathlib +import subprocess from run_tests import ( Backend ) +from .allplatformstests import git_init + from .baseplatformtests import BasePlatformTests +from mesonbuild.mesonlib import TemporaryDirectoryWinProof class PythonTests(BasePlatformTests): ''' @@ -43,3 +48,15 @@ class PythonTests(BasePlatformTests): with self.assertRaises(unittest.SkipTest): self.init(testdir, extra_args=['-Dpython=dir']) self.wipe() + + def test_dist(self): + with TemporaryDirectoryWinProof() as dirstr: + dirobj = pathlib.Path(dirstr) + mesonfile = dirobj / 'meson.build' + mesonfile.write_text('''project('test', 'c', version: '1') +pymod = import('python') +python = pymod.find_installation('python3', required: true) +''', encoding='utf-8') + git_init(dirstr) + self.init(dirstr) + subprocess.check_call(self.meson_command + ['dist', '-C', self.builddir], stdout=subprocess.DEVNULL) |