#
# Do some translation to ease our life down the road for comparison.
# Export it so that executed commands can use it.
#
# Do some translation to ease our life down the road for comparison.
# Export it so that executed commands can use it.
_bt_tests_plugins_path="${BT_TESTS_BUILDDIR}/../src/plugins"
# Colon-separated list of project plugin paths, if not set
_bt_tests_plugins_path="${BT_TESTS_BUILDDIR}/../src/plugins"
# Colon-separated list of project plugin paths, if not set
BT_TESTS_BABELTRACE_PLUGIN_PATH="${_bt_tests_plugins_path}/ctf:${_bt_tests_plugins_path}/utils:${_bt_tests_plugins_path}/text:${_bt_tests_plugins_path}/lttng-utils"
fi
export BT_TESTS_BABELTRACE_PLUGIN_PATH
# Directory containing the Python plugin provider library, if not set
BT_TESTS_BABELTRACE_PLUGIN_PATH="${_bt_tests_plugins_path}/ctf:${_bt_tests_plugins_path}/utils:${_bt_tests_plugins_path}/text:${_bt_tests_plugins_path}/lttng-utils"
fi
export BT_TESTS_BABELTRACE_PLUGIN_PATH
# Directory containing the Python plugin provider library, if not set
BT_TESTS_PROVIDER_DIR="${BT_TESTS_BUILDDIR}/../src/python-plugin-provider/.libs"
fi
export BT_TESTS_PROVIDER_DIR
# Directory containing the built `bt2` Python package, if not set
BT_TESTS_PROVIDER_DIR="${BT_TESTS_BUILDDIR}/../src/python-plugin-provider/.libs"
fi
export BT_TESTS_PROVIDER_DIR
# Directory containing the built `bt2` Python package, if not set
BT_TESTS_PYTHONPATH="${BT_TESTS_BUILDDIR}/../src/bindings/python/bt2/build/build_lib"
fi
export BT_TESTS_PYTHONPATH
# Name of the `awk` command to use when testing, if not set
BT_TESTS_PYTHONPATH="${BT_TESTS_BUILDDIR}/../src/bindings/python/bt2/build/build_lib"
fi
export BT_TESTS_PYTHONPATH
# Name of the `awk` command to use when testing, if not set
_bt_tests_py3_version=$("$BT_TESTS_PYTHON_BIN" -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')
# Name of the `python3-config` command to use when testing, if not set
_bt_tests_py3_version=$("$BT_TESTS_PYTHON_BIN" -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')
# Name of the `python3-config` command to use when testing, if not set
BT_TESTS_PYTHON_CONFIG_BIN="python3-config"
fi
export BT_TESTS_PYTHON_CONFIG_BIN
# Name of the `sed` command to use when testing, if not set
BT_TESTS_PYTHON_CONFIG_BIN="python3-config"
fi
export BT_TESTS_PYTHON_CONFIG_BIN
# Name of the `sed` command to use when testing, if not set
#
# This doesn't need to be exported from the point of view of this file,
# but the sourced `env.sh` above does export it.
#
# This doesn't need to be exported from the point of view of this file,
# but the sourced `env.sh` above does export it.
BT_CTF_TRACES_PATH="${BT_TESTS_DATADIR}/ctf-traces"
# Source the shell TAP utilities if `SH_TAP` is `1`
BT_CTF_TRACES_PATH="${BT_TESTS_DATADIR}/ctf-traces"
# Source the shell TAP utilities if `SH_TAP` is `1`
local -x DYLD_LIBRARY_PATH="${main_lib_path}${DYLD_LIBRARY_PATH:+:}${DYLD_LIBRARY_PATH:-}"
else
local -x LD_LIBRARY_PATH="${main_lib_path}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH:-}"
local -x DYLD_LIBRARY_PATH="${main_lib_path}${DYLD_LIBRARY_PATH:+:}${DYLD_LIBRARY_PATH:-}"
else
local -x LD_LIBRARY_PATH="${main_lib_path}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH:-}"
# On Windows, an embedded Python 3 interpreter needs a way to locate
# the path to its internal modules: set the `PYTHONHOME` variable to
# the prefix from `python3-config`.
# On Windows, an embedded Python 3 interpreter needs a way to locate
# the path to its internal modules: set the `PYTHONHOME` variable to
# the prefix from `python3-config`.
#
# Append it to existing `ASAN_OPTIONS` variable, such that we
# override the user's value if it contains `detect_leaks=1`.
#
# Append it to existing `ASAN_OPTIONS` variable, such that we
# override the user's value if it contains `detect_leaks=1`.
if "${BT_TESTS_CC_BIN}" --version | head -n 1 | bt_grep -q '^gcc'; then
local -r lib_asan="$("${BT_TESTS_CC_BIN}" -print-file-name=libasan.so)"
local -x LD_PRELOAD="${lib_asan}${LD_PRELOAD:+:}${LD_PRELOAD:-}"
if "${BT_TESTS_CC_BIN}" --version | head -n 1 | bt_grep -q '^gcc'; then
local -r lib_asan="$("${BT_TESTS_CC_BIN}" -print-file-name=libasan.so)"
local -x LD_PRELOAD="${lib_asan}${LD_PRELOAD:+:}${LD_PRELOAD:-}"
-
- 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[@]}"