From a0baab4a979e830f7dc4698c20b71e84dea6ff9d Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 28 Sep 2021 16:43:44 -0400 Subject: [PATCH] tests: rename BT_OS_TYPE to BT_TESTS_OS_TYPE Follow the naming scheme used by other testsuite environment variables. Change-Id: I26dfe20b0c06a9de4d1e4bd1418f15d17ed4477c Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/6455 Reviewed-by: Michael Jeanson Tested-by: jenkins --- tests/bindings/python/bt2/test_plugin.py | 2 +- tests/cli/convert/test_convert_args | 2 +- tests/cli/list-plugins/test_list_plugins | 2 +- tests/lib/conds/test_conds | 2 +- .../sink.ctf.fs/test_assume_single_trace | 2 +- tests/plugins/sink.ctf.fs/test_stream_names | 2 +- .../src.ctf.fs/query/test_query_trace_info.py | 4 +-- .../src.ctf.fs/test_deterministic_ordering | 2 +- tests/plugins/src.ctf.lttng-live/test_live | 2 +- tests/utils/utils.sh | 26 +++++++++---------- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/bindings/python/bt2/test_plugin.py b/tests/bindings/python/bt2/test_plugin.py index 80de97a3..4abf8846 100644 --- a/tests/bindings/python/bt2/test_plugin.py +++ b/tests/bindings/python/bt2/test_plugin.py @@ -50,7 +50,7 @@ class FindPluginsTestCase(unittest.TestCase): def test_find_file(self): extension = _TEST_PLUGIN_PLUGIN_EXTENSION_BY_OS.get( - os.environ['BT_OS_TYPE'], 'so' + os.environ['BT_TESTS_OS_TYPE'], 'so' ) plugin_name = 'babeltrace-plugin-utils.{}'.format(extension) path = os.path.join(_TEST_PLUGIN_PLUGINS_PATH, 'utils', '.libs', plugin_name) diff --git a/tests/cli/convert/test_convert_args b/tests/cli/convert/test_convert_args index 12e41bd0..7ac9843e 100755 --- a/tests/cli/convert/test_convert_args +++ b/tests/cli/convert/test_convert_args @@ -70,7 +70,7 @@ path_to_trace="${BT_CTF_TRACES_PATH}/succeed/succeed1" path_to_trace2="${BT_CTF_TRACES_PATH}/succeed/succeed2" output_path="/output/path" -if [ "$BT_OS_TYPE" = "mingw" ]; then +if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then # Use Windows native paths for comparison because Unix # paths are converted by the shell before they are passed # to the native babeltrace2 binary. diff --git a/tests/cli/list-plugins/test_list_plugins b/tests/cli/list-plugins/test_list_plugins index 7184aa46..3e42d1ad 100755 --- a/tests/cli/list-plugins/test_list_plugins +++ b/tests/cli/list-plugins/test_list_plugins @@ -34,7 +34,7 @@ ok "$?" "exit code is 0" grep --after-context=11 '^this-is-a-plugin:$' "${stdout_file}" > "${grep_stdout_file}" ok "$?" "entry for this-is-a-plugin is present" -if [ "$BT_OS_TYPE" = "mingw" ]; then +if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then platform_plugin_dir=$(cygpath -m "${plugin_dir}") else platform_plugin_dir="${plugin_dir}" diff --git a/tests/lib/conds/test_conds b/tests/lib/conds/test_conds index 48b4fe75..851079a4 100755 --- a/tests/lib/conds/test_conds +++ b/tests/lib/conds/test_conds @@ -16,7 +16,7 @@ source "$UTILSSH" reldir=lib/conds export BT_TESTS_LIB_CONDS_TRIGGER_BIN="$BT_TESTS_BUILDDIR/$reldir/conds-triggers" -if [ "$BT_OS_TYPE" = "mingw" ]; then +if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then BT_TESTS_LIB_CONDS_TRIGGER_BIN="$BT_TESTS_LIB_CONDS_TRIGGER_BIN.exe" fi diff --git a/tests/plugins/sink.ctf.fs/test_assume_single_trace b/tests/plugins/sink.ctf.fs/test_assume_single_trace index e8508dc3..dd84e044 100755 --- a/tests/plugins/sink.ctf.fs/test_assume_single_trace +++ b/tests/plugins/sink.ctf.fs/test_assume_single_trace @@ -37,7 +37,7 @@ bt_cli "$temp_stdout" "$temp_stderr" \ ok "$?" "run sink.ctf.fs with assume-single-trace=true" # Check stdout. -if [ "$BT_OS_TYPE" = "mingw" ]; then +if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then echo "Created CTF trace \`$(cygpath -m ${trace_dir})\`." > "$temp_expected_stdout" else echo "Created CTF trace \`${trace_dir}\`." > "$temp_expected_stdout" diff --git a/tests/plugins/sink.ctf.fs/test_stream_names b/tests/plugins/sink.ctf.fs/test_stream_names index 03ed4174..a60a1dbf 100755 --- a/tests/plugins/sink.ctf.fs/test_stream_names +++ b/tests/plugins/sink.ctf.fs/test_stream_names @@ -39,7 +39,7 @@ bt_cli "$temp_stdout" "$temp_stderr" \ ok "$?" "run babeltrace" # Check stdout. -if [ "$BT_OS_TYPE" = "mingw" ]; then +if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then echo "Created CTF trace \`$(cygpath -m ${temp_output_dir})\\trace\`." > "$temp_expected_stdout" else echo "Created CTF trace \`${trace_dir}\`." > "$temp_expected_stdout" diff --git a/tests/plugins/src.ctf.fs/query/test_query_trace_info.py b/tests/plugins/src.ctf.fs/query/test_query_trace_info.py index 71e934f1..eb8fd25c 100644 --- a/tests/plugins/src.ctf.fs/query/test_query_trace_info.py +++ b/tests/plugins/src.ctf.fs/query/test_query_trace_info.py @@ -133,7 +133,7 @@ class QueryTraceInfoPortNameTestCase(unittest.TestCase): }, ).query() - if os.environ['BT_OS_TYPE'] == 'mingw': + if os.environ['BT_TESTS_OS_TYPE'] == 'mingw': os_stream_path = ( '\\tests\\data\\ctf-traces\\intersection\\3eventsintersect\\' ) @@ -164,7 +164,7 @@ class QueryTraceInfoPortNameTestCase(unittest.TestCase): {"inputs": [os.path.join(test_ctf_traces_path, "succeed", "succeed1")]}, ).query() - if os.environ['BT_OS_TYPE'] == 'mingw': + if os.environ['BT_TESTS_OS_TYPE'] == 'mingw': os_stream_path = '\\tests\\data\\ctf-traces\\succeed\\succeed1\\dummystream' else: os_stream_path = '/tests/data/ctf-traces/succeed/succeed1/dummystream' diff --git a/tests/plugins/src.ctf.fs/test_deterministic_ordering b/tests/plugins/src.ctf.fs/test_deterministic_ordering index f832200b..02a76c20 100755 --- a/tests/plugins/src.ctf.fs/test_deterministic_ordering +++ b/tests/plugins/src.ctf.fs/test_deterministic_ordering @@ -42,7 +42,7 @@ trace_a_corrupted="${traces_dir}/a-corrupted" trace_b_not_corrupted="${traces_dir}/b-not-corrupted" trace_c_corrupted="${traces_dir}/c-corrupted" -if [ "$BT_OS_TYPE" = "mingw" ]; then +if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then # The MSYS2 shell makes a mess trying to convert the Unix-like paths # to Windows-like paths, so just disable the automatic conversion and # do it by hand. diff --git a/tests/plugins/src.ctf.lttng-live/test_live b/tests/plugins/src.ctf.lttng-live/test_live index bbda1d36..deee081a 100755 --- a/tests/plugins/src.ctf.lttng-live/test_live +++ b/tests/plugins/src.ctf.lttng-live/test_live @@ -38,7 +38,7 @@ this_dir_relative="plugins/src.ctf.lttng-live" test_data_dir="$BT_TESTS_DATADIR/$this_dir_relative" trace_dir="$BT_CTF_TRACES_PATH" -if [ "$BT_OS_TYPE" = "mingw" ]; then +if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then # Same as the above, but in Windows form (C:\foo\bar) instead of Unix form # (/c/foo/bar). trace_dir_native=$(cygpath -w "${trace_dir}") diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index a6b17dbe..afdc856b 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -25,27 +25,27 @@ fi # We do a bit of translation to ease our life down the road for comparison. # Export it so that called executables can use it. # [1] https://en.wikipedia.org/wiki/Uname#Examples -if [ "x${BT_OS_TYPE:-}" = "x" ]; then - BT_OS_TYPE="$(uname -s)" - case "$BT_OS_TYPE" in +if [ "x${BT_TESTS_OS_TYPE:-}" = "x" ]; then + BT_TESTS_OS_TYPE="$(uname -s)" + case "$BT_TESTS_OS_TYPE" in MINGW*) - BT_OS_TYPE="mingw" + BT_TESTS_OS_TYPE="mingw" ;; Darwin) - BT_OS_TYPE="darwin" + BT_TESTS_OS_TYPE="darwin" ;; Linux) - BT_OS_TYPE="linux" + BT_TESTS_OS_TYPE="linux" ;; CYGWIN*) - BT_OS_TYPE="cygwin" + BT_TESTS_OS_TYPE="cygwin" ;; *) - BT_OS_TYPE="unsupported" + BT_TESTS_OS_TYPE="unsupported" ;; esac fi -export BT_OS_TYPE +export BT_TESTS_OS_TYPE # Allow overriding the source and build directories if [ "x${BT_TESTS_SRCDIR:-}" = "x" ]; then @@ -69,7 +69,7 @@ fi # Allow overriding the babeltrace2 executables if [ "x${BT_TESTS_BT2_BIN:-}" = "x" ]; then BT_TESTS_BT2_BIN="$BT_TESTS_BUILDDIR/../src/cli/babeltrace2" - if [ "$BT_OS_TYPE" = "mingw" ]; then + if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then BT_TESTS_BT2_BIN="${BT_TESTS_BT2_BIN}.exe" fi fi @@ -296,9 +296,9 @@ run_python_bt2() { local main_lib_path="${BT_TESTS_BUILDDIR}/../src/lib/.libs" # Set the library search path so the python interpreter can load libbabeltrace2 - if [ "$BT_OS_TYPE" = "mingw" ] || [ "$BT_OS_TYPE" = "cygwin" ]; then + if [ "$BT_TESTS_OS_TYPE" = "mingw" ] || [ "$BT_TESTS_OS_TYPE" = "cygwin" ]; then env_args+=("PATH=${main_lib_path}:${PATH:-}") - elif [ "$BT_OS_TYPE" = "darwin" ]; then + elif [ "$BT_TESTS_OS_TYPE" = "darwin" ]; then env_args+=("DYLD_LIBRARY_PATH=${main_lib_path}:${DYLD_LIBRARY_PATH:-}") else env_args+=("LD_LIBRARY_PATH=${main_lib_path}:${LD_LIBRARY_PATH:-}") @@ -307,7 +307,7 @@ run_python_bt2() { # On Windows, an embedded Python interpreter needs a way to locate the path # to it's internal modules, set the prefix from python-config to the # PYTHONHOME variable. - if [ "$BT_OS_TYPE" = "mingw" ]; then + if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then env_args+=("PYTHONHOME=$($BT_TESTS_PYTHON_CONFIG_BIN --prefix)") fi -- 2.34.1