X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=a4e7aae1a3ff5a9f0942394b0502151039a32b12;hb=fca73c7199dce6774ed6f0d5d7e28aa9e3e45846;hp=10d984441e22dd51a1b603fe4d137d145bd32f9f;hpb=82057d0ccb3be005f1c1d292a3ae663dec6499ad;p=babeltrace.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 10d98444..a4e7aae1 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -155,7 +155,7 @@ _bt_tests_set_var_def BT_TESTS_PYTHON_BIN python3 # Major and minor version of the `python3` command to use when testing. # # This doesn't need to be exported, but it needs to remain set for -# run_python() to use it. +# bt_run_in_py_utils_env() to use it. _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 @@ -376,7 +376,7 @@ _bt_tests_check_coverage() { # Executes a command within an environment which can import the testing # Python modules (in `tests/utils/python`). -run_python() { +bt_run_in_py_utils_env() { local our_pythonpath=$BT_TESTS_SRCDIR/utils/python if [[ $_bt_tests_py3_version =~ 3.[45] ]]; then @@ -436,7 +436,7 @@ run_python_bt2() { local -x ASAN_OPTIONS=${ASAN_OPTIONS:-}${ASAN_OPTIONS:+,}detect_leaks=0 fi - run_python "$@" + bt_run_in_py_utils_env "$@" } # Runs the Python tests matching the pattern `$2` (optional, `*` if @@ -485,5 +485,5 @@ gen_mctf_trace() { ) echo "Running: \`${cmd[*]}\`" >&2 - run_python "${cmd[@]}" + bt_run_in_py_utils_env "${cmd[@]}" }