summaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@igalia.com>2024-10-30 15:53:52 +0100
committerXavier Claessens <xclaesse@gmail.com>2025-11-05 08:12:46 -0500
commit2e0e2663b80950a4b4106160a0cc6db12a39a559 (patch)
treefce4c1e4a82b97328ee66c2ae8dbbc5ba711ec85 /test cases/common
parent60e3cc1c58c208c635bda23a7c62a92ae84cb6b6 (diff)
downloadmeson-2e0e2663b80950a4b4106160a0cc6db12a39a559.tar.gz
ExternalProgram: add cmd_array to complete the offfering
In case of python and especially in the case of pyInstaller where the python command is meson.exe runpython, it should not be full path to be used but cmd_array. Fixing #13834
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/26 find program/meson.build20
1 files changed, 19 insertions, 1 deletions
diff --git a/test cases/common/26 find program/meson.build b/test cases/common/26 find program/meson.build
index a20f6b45a..72d311c41 100644
--- a/test cases/common/26 find program/meson.build
+++ b/test cases/common/26 find program/meson.build
@@ -1,4 +1,4 @@
-project('find program')
+project('find program', meson_version: '>= 1.10.0',)
if build_machine.system() == 'windows'
# Things Windows does not provide:
@@ -40,3 +40,21 @@ assert(not prog.found(), 'Program should not be found')
prog = find_program('test_subdir.py', dirs : ['/nonexistent', meson.current_source_dir() / 'scripts'])
assert(prog.found(), 'Program should be found')
+
+prog = find_program('print-version.py')
+if build_machine.system() != 'cygwin'
+ assert(prog.cmd_array() != [prog.full_path()])
+ assert(prog.cmd_array().length() == 2)
+endif
+
+ret = run_command(prog.cmd_array(),'--version', check: true)
+assert(ret.returncode() == 0)
+assert(ret.stdout().strip() == '1.0')
+
+if build_machine.system() == 'windows'
+ prog = find_program('cmd.exe')
+ assert(prog.cmd_array() == [prog.full_path()])
+else
+ prog = find_program('ld')
+ assert(prog.cmd_array() == [prog.full_path()])
+endif \ No newline at end of file