summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-07-31 17:18:42 +1000
committerDylan Baker <dylan@pnwbakers.com>2024-08-27 08:43:32 -0700
commit3c0de471228420c333bb98be35a28705d0ec063d (patch)
treee6c69261378b2cf564bc0457e9d01bfca0a05130 /test cases
parent75e5ca58374fc7d070a6e34822046391cc5a24e5 (diff)
downloadmeson-3c0de471228420c333bb98be35a28705d0ec063d.tar.gz
Allow external programs in test()'s 'args' parameter
Although it's not especially common, there are certainly cases where it's useful to pass the path to an external program to a test program. Fixes: https://github.com/mesonbuild/meson/issues/3552 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/41 test args/meson.build4
-rwxr-xr-xtest cases/common/41 test args/wrap.py6
-rw-r--r--test cases/failing/112 run_target in test/test.json2
3 files changed, 11 insertions, 1 deletions
diff --git a/test cases/common/41 test args/meson.build b/test cases/common/41 test args/meson.build
index 7efd8d5da..ddd369e7f 100644
--- a/test cases/common/41 test args/meson.build
+++ b/test cases/common/41 test args/meson.build
@@ -45,3 +45,7 @@ custompathtgt = custom_target('testpathappend',
build_always : true,
command : [pathtester],
env : env)
+
+# https://github.com/mesonbuild/meson/issues/3552
+wrap = find_program('wrap.py')
+test('external program arg', wrap, args : [testerpy, testfile])
diff --git a/test cases/common/41 test args/wrap.py b/test cases/common/41 test args/wrap.py
new file mode 100755
index 000000000..87508e008
--- /dev/null
+++ b/test cases/common/41 test args/wrap.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+
+import subprocess
+import sys
+
+subprocess.run(sys.argv[1:])
diff --git a/test cases/failing/112 run_target in test/test.json b/test cases/failing/112 run_target in test/test.json
index 100db9482..515897899 100644
--- a/test cases/failing/112 run_target in test/test.json
+++ b/test cases/failing/112 run_target in test/test.json
@@ -1,7 +1,7 @@
{
"stdout": [
{
- "line": "test cases/failing/112 run_target in test/meson.build:7:0: ERROR: test keyword argument 'args' was of type array[RunTarget] but should have been array[str | File | BuildTarget | CustomTarget | CustomTargetIndex]"
+ "line": "test cases/failing/112 run_target in test/meson.build:7:0: ERROR: test keyword argument 'args' was of type array[RunTarget] but should have been array[str | File | BuildTarget | CustomTarget | CustomTargetIndex | ExternalProgram]"
}
]
}