tests/utils/utils.sh: gen_mctf_trace(): use an array for the command line
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 10 Nov 2023 04:36:37 +0000 (23:36 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 7 Feb 2024 21:25:56 +0000 (16:25 -0500)
This removes the redundancy to both print and run the command line.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I9100aa02c221e3699de726668a4de1d6b65ec2d9

tests/utils/utils.sh

index d6d061846f3b53a3a8a8b75b30cc08909f98c328..2276734392f0cac6a8cb366968a5ec5d66278cfd 100644 (file)
@@ -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[@]}"
 }
This page took 0.024185 seconds and 4 git commands to generate.