meson: Run the Python test script with Python, not bash

The python build option can be used to swap to a different interpreter,
for environments like the Steam Runtime where the python3 executable in
the PATH is extremely old but there is a better interpreter available.

This is treated as non-optional, because Meson is written in Python,
so the situation where there is no Python interpreter at build-time
shouldn't arise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2022-02-19 14:47:12 +00:00
parent 5750517e1c
commit 12c920b492
3 changed files with 19 additions and 2 deletions

View File

@@ -46,10 +46,16 @@ foreach pair : test_programs
endforeach
foreach test_script : test_scripts
if test_script.endswith('.py')
interpreter = python
else
interpreter = bash
endif
if meson.version().version_compare('>=0.50.0')
test(
test_script,
bash,
interpreter,
args : [test_script],
env : test_env,
protocol : 'tap',
@@ -57,7 +63,7 @@ foreach test_script : test_scripts
else
test(
test_script,
bash,
interpreter,
args : [test_script],
env : test_env,
)