From 31d2049bc9259ef24ef21d2a5352096057a09877 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 10 Nov 2023 09:09:21 -0500 Subject: [PATCH] tests/utils: `run-python-bt2.sh` -> `run-in-py-env.sh` This makes it consistent with the underlying Bash function name and indicates that it doesn't need to run Python itself. Signed-off-by: Philippe Proulx Change-Id: If030bcea8349edc4d4ba1425a64778c08227101d --- CONTRIBUTING.adoc | 22 +++++++++---------- tests/utils/Makefile.am | 2 +- .../{run-python-bt2.sh => run-in-py-env.sh} | 6 ++--- 3 files changed, 15 insertions(+), 15 deletions(-) rename tests/utils/{run-python-bt2.sh => run-in-py-env.sh} (88%) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 268c4445..c31f9a89 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -1505,11 +1505,11 @@ $ ./tests/plugins/sink.text.pretty/test-enum.sh ==== Python -You can use the `tests/utils/run-python-bt2.sh` script to run any -command within an environment making the build's `bt2` Python package -available. +You can use the `tests/utils/run-in-py-env.sh` script to run any command +within an environment making the build's `bt2` Python package available, +as well as the testing utility Python modules. -`run-python-bt2.sh` uses <> which needs to know the +`run-in-py-env.sh` uses <> which needs to know the build directory, so make sure you set the `BT_TESTS_BUILDDIR` environment variable correctly _if you build out of tree_, for example: @@ -1518,10 +1518,10 @@ $ export BT_TESTS_BUILDDIR=/path/to/build/babeltrace/tests ---- You can run any command which needs the `bt2` Python package through -`run-python-bt2.sh`, for example: +`run-in-py-env.sh`, for example: ---- -$ ./tests/utils/run-python-bt2.sh ipython3 +$ ./tests/utils/run-in-py-env.sh ipython3 ---- === Report format @@ -1567,13 +1567,13 @@ To run all the `bt2` Python package tests: * Run: + ---- -$ ./tests/utils/run-python-bt2.sh ./tests/bindings/python/bt2/test-python-bt2.sh +$ ./tests/utils/run-in-py-env.sh ./tests/bindings/python/bt2/test-python-bt2.sh ---- + or: + ---- -$ ./tests/utils/run-python-bt2.sh python3 ./tests/utils/python/testrunner.py \ +$ ./tests/utils/run-in-py-env.sh python3 ./tests/utils/python/testrunner.py \ ./tests/bindings/python/bt2/ -p '*.py' ---- @@ -1583,7 +1583,7 @@ To run **all the tests** in a test module (for example, * Run: + ---- -$ ./tests/utils/run-python-bt2.sh python3 ./tests/utils/python/testrunner.py \ +$ ./tests/utils/run-in-py-env.sh python3 ./tests/utils/python/testrunner.py \ ./tests/bindings/python/bt2 -t test_value ---- @@ -1593,7 +1593,7 @@ To run a **specific test case** (for example, `RealValueTestCase` within * Run: + ---- -$ ./tests/utils/run-python-bt2.sh python3 ./tests/utils/python/testrunner.py \ +$ ./tests/utils/run-in-py-env.sh python3 ./tests/utils/python/testrunner.py \ ./tests/bindings/python/bt2/ -t test_value.RealValueTestCase ---- @@ -1603,7 +1603,7 @@ To run a **specific test** (for example, * Run: + ---- -$ ./tests/utils/run-python-bt2.sh python3 ./tests/utils/python/testrunner.py \ +$ ./tests/utils/run-in-py-env.sh python3 ./tests/utils/python/testrunner.py \ ./tests/bindings/python/bt2/ -t test_value.RealValueTestCase.test_assign_pos_int ---- diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am index 63ad1087..e7065be2 100644 --- a/tests/utils/Makefile.am +++ b/tests/utils/Makefile.am @@ -10,6 +10,6 @@ libtestcommon_la_SOURCES = common.c common.h EXTRA_DIST = python dist_check_SCRIPTS = \ - run-python-bt2.sh \ + run-in-py-env.sh \ tap-driver.sh \ utils.sh diff --git a/tests/utils/run-python-bt2.sh b/tests/utils/run-in-py-env.sh similarity index 88% rename from tests/utils/run-python-bt2.sh rename to tests/utils/run-in-py-env.sh index ada27642..2168f87b 100755 --- a/tests/utils/run-python-bt2.sh +++ b/tests/utils/run-in-py-env.sh @@ -10,7 +10,7 @@ # bt2 Python bindings. For example, one could use it to run a specific Python # binding test case with: # -# $ tests/utils/run_python_bt2 python3 ./tests/utils/python/testrunner.py \ +# $ tests/utils/run-in-py-utils-bt2-env.sh python3 ./tests/utils/python/testrunner.py \ # -t test_value.MapValueTestCase.test_deepcopy \ # ./tests/bindings/python/bt2 @@ -24,7 +24,7 @@ fi source "$UTILSSH" usage() { - echo "Usage: run_python_bt2 [PYTHON_BIN] ..." + echo "Usage: run-in-py-utils-bt2-env.sh [PYTHON_BIN] ..." echo "" echo "Run a binary with the python environment set to use the 'bt2' module" echo "from the build system prior to installation." @@ -48,4 +48,4 @@ if [ ! -f "$BT_TESTS_BUILDDIR/Makefile" ]; then exit 1 fi -bt_run_in_py_utils_bt2_env "${@}" +bt_run_in_py_env "${@}" -- 2.34.1