From 3c0de471228420c333bb98be35a28705d0ec063d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 31 Jul 2024 17:18:42 +1000 Subject: 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 --- docs/markdown/snippets/test_args_accepts_external_program.md | 10 ++++++++++ docs/yaml/functions/benchmark.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 docs/markdown/snippets/test_args_accepts_external_program.md (limited to 'docs') diff --git a/docs/markdown/snippets/test_args_accepts_external_program.md b/docs/markdown/snippets/test_args_accepts_external_program.md new file mode 100644 index 000000000..d730ad5f3 --- /dev/null +++ b/docs/markdown/snippets/test_args_accepts_external_program.md @@ -0,0 +1,10 @@ +## test() and benchmark() functions accept new types + +`test` and `benchmark` now accept ExternalPrograms (as returned by +`find_program`) in the `args` list. This can be useful where the test +executable is a wrapper which invokes another program given as an +argument. + +```meson +test('some_test', find_program('sudo'), args : [ find_program('sh'), 'script.sh' ]) +``` diff --git a/docs/yaml/functions/benchmark.yaml b/docs/yaml/functions/benchmark.yaml index 0323b26e4..7a555a42d 100644 --- a/docs/yaml/functions/benchmark.yaml +++ b/docs/yaml/functions/benchmark.yaml @@ -28,7 +28,7 @@ posargs: kwargs: args: - type: list[str | file | tgt] + type: list[str | file | tgt | external_program] description: Arguments to pass to the executable env: -- cgit v1.2.3