summaryrefslogtreecommitdiff
path: root/run_meson_command_tests.py
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2020-08-03 11:48:27 -0400
committerJohn Ericson <git@JohnEricson.me>2020-08-03 11:48:27 -0400
commiteaf6343c065842b9719793066e765b2e5f1c2f3b (patch)
tree1bfeac5297ba489721e704e63c28f33d0fb98990 /run_meson_command_tests.py
parent87aa98c1787d800145853a8e84654e4c54ee1078 (diff)
parent70edf82c6c77902cd64f44848302bbac92d611d8 (diff)
downloadmeson-lang-enum.tar.gz
Merge remote-tracking branch 'upstream/master' into lang-enumlang-enum
Diffstat (limited to 'run_meson_command_tests.py')
-rwxr-xr-xrun_meson_command_tests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/run_meson_command_tests.py b/run_meson_command_tests.py
index 9dfb62e08..7bc6185f1 100755
--- a/run_meson_command_tests.py
+++ b/run_meson_command_tests.py
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys
import os
import tempfile
import unittest
@@ -23,6 +22,8 @@ import zipapp
from pathlib import Path
from mesonbuild.mesonlib import windows_proof_rmtree, python_command, is_windows
+from mesonbuild.coredata import version as meson_version
+
def get_pypath():
import sysconfig
@@ -128,6 +129,10 @@ class CommandTests(unittest.TestCase):
os.environ['PYTHONPATH'] = os.path.join(str(pylibdir), '')
os.environ['PATH'] = str(bindir) + os.pathsep + os.environ['PATH']
self._run(python_command + ['setup.py', 'install', '--prefix', str(prefix)])
+ # Fix importlib-metadata by appending all dirs in pylibdir
+ PYTHONPATHS = [pylibdir] + [x for x in pylibdir.iterdir()]
+ PYTHONPATHS = [os.path.join(str(x), '') for x in PYTHONPATHS]
+ os.environ['PYTHONPATH'] = os.pathsep.join(PYTHONPATHS)
# Check that all the files were installed correctly
self.assertTrue(bindir.is_dir())
self.assertTrue(pylibdir.is_dir())
@@ -195,4 +200,5 @@ class CommandTests(unittest.TestCase):
if __name__ == '__main__':
- sys.exit(unittest.main(buffer=True))
+ print('Meson build system', meson_version, 'Command Tests')
+ raise SystemExit(unittest.main(buffer=True))