diff options
| author | Eli Schwartz <eschwartz@archlinux.org> | 2022-05-05 23:39:34 -0400 |
|---|---|---|
| committer | Xavier Claessens <xclaesse@gmail.com> | 2023-02-24 20:45:00 -0500 |
| commit | cf07596cf6bc280dac0afff505147ca626c79453 (patch) | |
| tree | ef7a4ab1e652bca9131f5b53eedcc056b86aa6e1 /test cases/failing | |
| parent | 9f05d45b7084866f0b306f4685a118e5fea138af (diff) | |
| download | meson-cf07596cf6bc280dac0afff505147ca626c79453.tar.gz | |
test cases: use best practices method to find the python3 program
We do not need the python module's find_installation() for this, as this
does various things to set up building and installing python modules
(pure python and C-API). This functionality is already tested in the
python tests.
Elsewhere, when we just need an interpreter capable of running python
scripts in order to guarantee a useful scripting language for custom
commands, it suffices to use find_program(), which does not run an
introspection script or do module imports, and is thus faster and
a bit cleaner.
Either way, both methods are guaranteed to find the python3 interpreter,
deferring to mesonlib.python_command for that guarantee.
test "71 summary" can sometimes return the python command with the
".exe" part all uppercased for mysterious Windows reasons. Smooth this
over with ExternalProgram.
Diffstat (limited to 'test cases/failing')
| -rw-r--r-- | test cases/failing/115 run_target in test/meson.build | 4 | ||||
| -rw-r--r-- | test cases/failing/116 run_target in add_install_script/meson.build | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test cases/failing/115 run_target in test/meson.build b/test cases/failing/115 run_target in test/meson.build index 1d448ecc5..117009e3f 100644 --- a/test cases/failing/115 run_target in test/meson.build +++ b/test cases/failing/115 run_target in test/meson.build @@ -1,7 +1,7 @@ project('trivial test', 'c') -py_inst = import('python').find_installation() +python = find_program('python3') exe = executable('trivialprog', 'trivial.c') -runt = run_target('invalid', command: [py_inst, '--version']) +runt = run_target('invalid', command: [python, '--version']) test('runtest', exe, args: runt) diff --git a/test cases/failing/116 run_target in add_install_script/meson.build b/test cases/failing/116 run_target in add_install_script/meson.build index f8ae3a1c4..d3634bfb5 100644 --- a/test cases/failing/116 run_target in add_install_script/meson.build +++ b/test cases/failing/116 run_target in add_install_script/meson.build @@ -1,7 +1,7 @@ project('trivial test', 'c') -py_inst = import('python').find_installation() +python = find_program('python3') exe = executable('trivialprog', 'trivial.c') -runt = run_target('invalid', command: [py_inst, '--version']) +runt = run_target('invalid', command: [python, '--version']) meson.add_install_script(exe, runt) |
