tests/utils/utils.sh: run_python_bt2() -> bt_run_in_py_env()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 10 Nov 2023 14:03:15 +0000 (09:03 -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: I5635f04f494c50e1955a27adaae28f964c336bf3

tests/lib/test-fields.sh
tests/plugins/sink.text.pretty/test-enum.sh
tests/utils/run-python-bt2.sh
tests/utils/utils.sh

index 166d4b2bed0f812d085bebb2b05c0f6675778afd..b0d6772e9fcf9ae50d2a48783ddc56fa93f31c96 100755 (executable)
@@ -14,4 +14,4 @@ fi
 # shellcheck source=../utils/utils.sh
 source "$UTILSSH"
 
-run_python_bt2 "${BT_TESTS_BUILDDIR}/lib/test-fields-bin"
+bt_run_in_py_env "${BT_TESTS_BUILDDIR}/lib/test-fields-bin"
index f91abb5f45c6355ec07c7831c950c1aa34953861..fb68ca4970b09af55d25837b826f2a9b4096cbe8 100755 (executable)
@@ -35,7 +35,7 @@ function compare_enum_sorted
        # data structures differently (e.g. dictionaries are insertion sorted
        # since Python 3.7).
 
-       run_python_bt2 "${BT_TESTS_PYTHON_BIN}" "${BT_TESTS_SRCDIR}/utils/python/split_sort_compare.py" \
+       bt_run_in_py_env "${BT_TESTS_PYTHON_BIN}" "${BT_TESTS_SRCDIR}/utils/python/split_sort_compare.py" \
                "$(cat "$expected_file")" "$(cat "$actual_file")"
 }
 
index 574900a2c48c586484ec25c712b5cfd14d06b94c..ada27642180a009620c18592d94db98458098636 100755 (executable)
@@ -48,4 +48,4 @@ if [ ! -f "$BT_TESTS_BUILDDIR/Makefile" ]; then
        exit 1
 fi
 
-run_python_bt2 "${@}"
+bt_run_in_py_utils_bt2_env "${@}"
index a4e7aae1a3ff5a9f0942394b0502151039a32b12..b14b806429bfd8323e47efcd9c402ece8d8f444e 100644 (file)
@@ -128,7 +128,7 @@ fi
 export BT_TESTS_BT2_BIN
 
 # This doesn't need to be exported, but it needs to remain set for
-# run_python_bt2() to use it.
+# bt_run_in_py_env() to use it.
 #
 # TODO: Remove when `tests/bindings/python/bt2/test_plugin.py` is fixed.
 _bt_tests_plugins_path=$BT_TESTS_BUILDDIR/../src/plugins
@@ -222,7 +222,7 @@ bt_cli() {
        local -r args=("$@")
 
        echo "Running: \`$BT_TESTS_BT2_BIN ${args[*]}\`" >&2
-       run_python_bt2 "$BT_TESTS_BT2_BIN" "${args[@]}" 1>"$stdout_file" 2>"$stderr_file"
+       bt_run_in_py_env "$BT_TESTS_BT2_BIN" "${args[@]}" 1>"$stdout_file" 2>"$stderr_file"
 }
 
 # Checks the differences between:
@@ -391,7 +391,7 @@ bt_run_in_py_utils_env() {
 
 # Executes a command within an environment which can import the testing
 # Python modules (in `tests/utils/python`) and the `bt2` Python package.
-run_python_bt2() {
+bt_run_in_py_env() {
        local -x BABELTRACE_PLUGIN_PATH=$BT_TESTS_BABELTRACE_PLUGIN_PATH
        local -x LIBBABELTRACE2_PLUGIN_PROVIDER_DIR=$BT_TESTS_PROVIDER_DIR
        local -x BT_TESTS_DATADIR=$BT_TESTS_DATADIR
@@ -442,7 +442,7 @@ run_python_bt2() {
 # Runs the Python tests matching the pattern `$2` (optional, `*` if
 # missing) in the directory `$1` using `testrunner.py`.
 #
-# This function uses run_python_bt2(), therefore such tests can import
+# This function uses bt_run_in_py_env(), therefore such tests can import
 # the testing Python modules (in `tests/utils/python`) and the `bt2`
 # Python package.
 run_python_bt2_test() {
@@ -456,7 +456,7 @@ run_python_bt2_test() {
                python_exec=$BT_TESTS_PYTHON_BIN
        fi
 
-       run_python_bt2 \
+       bt_run_in_py_env \
                "$python_exec" "$BT_TESTS_SRCDIR/utils/python/testrunner.py" \
                --pattern "$test_pattern" "$test_dir"
 
This page took 0.027387 seconds and 4 git commands to generate.