diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2022-04-11 21:05:20 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-04-11 21:05:20 +0300 |
commit | bfca4c90de5fc98e25fefdd08f8cf3a624e118c9 (patch) | |
tree | 6dc66ac130b500f27448072499c20e1884d0e448 | |
parent | e5aa47d8af917282794a8da3956ce444b8d8378d (diff) | |
download | meson-pydisttest.zip meson-pydisttest.tar.gz meson-pydisttest.tar.bz2 |
Add regression test for Python dist.pydisttest
-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..f1e17c1 100644 --- a/unittests/pythontests.py +++ b/unittests/pythontests.py @@ -14,6 +14,9 @@ import os import unittest +import tempfile +import pathlib +import subprocess from run_tests import ( Backend @@ -43,3 +46,17 @@ class PythonTests(BasePlatformTests): with self.assertRaises(unittest.SkipTest): self.init(testdir, extra_args=['-Dpython=dir']) self.wipe() + + def test_dist(self): + with tempfile.TemporaryDirectory() 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) +''') + subprocess.check_call(['git', 'init'], cwd=dirobj) + subprocess.check_call(['git', 'add', 'meson.build'], cwd=dirobj) + subprocess.check_call(['git', 'commit', '-a', '-m', 'message'], cwd=dirobj) + self.init(dirobj) + subprocess.check_call(self.meson_command + ['dist', '-C', self.builddir]) |