tests/utils/utils.sh: run_python() -> bt_run_in_py_utils_env()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 10 Nov 2023 13:59:49 +0000 (08:59 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 7 Feb 2024 21:25:56 +0000 (16:25 -0500)
Adding the `bt_` prefix like other functions in `utils.sh` and renaming
the rest to indicate that it runs something in a specific environment,
not necessarily Python itself.

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

tests/plugins/src.ctf.lttng-live/test-live.sh
tests/utils/utils.sh

index 8a7bb608e683f459526d981be475733ccf3d8c40..e488289b0366cad621fc84f24fd7e66181ee8379 100755 (executable)
@@ -57,7 +57,7 @@ lttng_live_server() {
 
        # start server
        diag "$BT_TESTS_PYTHON_BIN $server_script ${server_args[*]}"
-       run_python "$BT_TESTS_PYTHON_BIN" "$server_script" "${server_args[@]}" 1>&2 &
+       bt_run_in_py_utils_env "$BT_TESTS_PYTHON_BIN" "$server_script" "${server_args[@]}" 1>&2 &
 
        # write PID to file
        echo $! > "$pid_file"
index 10d984441e22dd51a1b603fe4d137d145bd32f9f..a4e7aae1a3ff5a9f0942394b0502151039a32b12 100644 (file)
@@ -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[@]}"
 }
This page took 0.025313 seconds and 4 git commands to generate.