From b522231c88173b69fcc8c20a337aa3e83978b3f3 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 24 Aug 2024 09:34:46 +0300 Subject: [PATCH] Convert Bash usage to a Python script. --- test cases/common/41 test args/meson.build | 4 ++-- test cases/common/41 test args/pathtester.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 test cases/common/41 test args/pathtester.py diff --git a/test cases/common/41 test args/meson.build b/test cases/common/41 test args/meson.build index 4894f3e16..7efd8d5da 100644 --- a/test cases/common/41 test args/meson.build +++ b/test cases/common/41 test args/meson.build @@ -38,10 +38,10 @@ test('custom target arg', tester, args : testfilect, env : env_array) env = environment() env.append('PATH', 'something') -bash = find_program('bash') +pathtester = find_program('pathtester.py') custompathtgt = custom_target('testpathappend', output : 'nothing.txt', build_always : true, - command : [bash, '-c', 'env'], + command : [pathtester], env : env) diff --git a/test cases/common/41 test args/pathtester.py b/test cases/common/41 test args/pathtester.py new file mode 100644 index 000000000..101136611 --- /dev/null +++ b/test cases/common/41 test args/pathtester.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +import sys, subprocess + +if sys.platorm() == 'win32': + cmd = ['xcopy', '/?'] +else: + cmd = ['env'] + +rc = subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) +sys.exit(rc.returncode)