tests/utils/utils.sh: gen_mctf_trace(): use an array for the command line
[babeltrace.git] / tests / utils / utils.sh
index 3b2ee8886877f55f0429ad20dc541311da074166..2276734392f0cac6a8cb366968a5ec5d66278cfd 100644 (file)
@@ -112,7 +112,7 @@ unset -f _source_env_sh
 if [ -z "${BT_TESTS_BT2_BIN:-}" ]; then
        BT_TESTS_BT2_BIN="$BT_TESTS_BUILDDIR/../src/cli/babeltrace2"
        if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then
-               BT_TESTS_BT2_BIN="${BT_TESTS_BT2_BIN}.exe"
+               BT_TESTS_BT2_BIN+=".exe"
        fi
 fi
 export BT_TESTS_BT2_BIN
@@ -374,7 +374,7 @@ if [[ ${SH_TAP:-} == 1 ]]; then
 fi
 
 # Forwards the arguments to `coverage run`.
-check_coverage() {
+_bt_tests_check_coverage() {
        coverage run "$@"
 }
 
@@ -457,7 +457,7 @@ run_python_bt2_test() {
        local python_exec
 
        if test "${BT_TESTS_COVERAGE:-}" = "1"; then
-               python_exec="check_coverage"
+               python_exec="_bt_tests_check_coverage"
        else
                python_exec="${BT_TESTS_PYTHON_BIN}"
        fi
@@ -486,8 +486,12 @@ run_python_bt2_test() {
 gen_mctf_trace() {
        local -r input_file="$1"
        local -r base_dir="$2"
-
-       diag "Running: \`${BT_TESTS_PYTHON_BIN} ${BT_TESTS_SRCDIR}/utils/python/mctf.py --base-dir ${base_dir} ${input_file}\`"
-       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.024049 seconds and 4 git commands to generate.