From ce8c884d114d141a5ee7c560ec2cffd766d5228c Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 9 Nov 2023 23:36:37 -0500 Subject: [PATCH] tests/utils/utils.sh: gen_mctf_trace(): use an array for the command line This removes the redundancy to both print and run the command line. Signed-off-by: Philippe Proulx Change-Id: I9100aa02c221e3699de726668a4de1d6b65ec2d9 --- tests/utils/utils.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index d6d06184..22767343 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -486,8 +486,12 @@ run_python_bt2_test() { gen_mctf_trace() { local -r input_file="$1" local -r base_dir="$2" - - echo "Running: \`${BT_TESTS_PYTHON_BIN} ${BT_TESTS_SRCDIR}/utils/python/mctf.py --base-dir ${base_dir} ${input_file}\`" >&2 - run_python "${BT_TESTS_PYTHON_BIN}" "${BT_TESTS_SRCDIR}/utils/python/mctf.py" \ - --base-dir "${base_dir}" "${input_file}" + local -r cmd=( + "$BT_TESTS_PYTHON_BIN" "$BT_TESTS_SRCDIR/utils/python/mctf.py" + --base-dir "$base_dir" + "$input_file" + ) + + echo "Running: \`${cmd[*]}\`" >&2 + run_python "${cmd[@]}" } -- 2.34.1