tests: fix shellcheck warnings in plugins/flt.lttng-utils.debug-info/test_succeed
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Feb 2020 19:04:18 +0000 (14:04 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 26 Feb 2020 14:10:00 +0000 (09:10 -0500)
Fix the path to utils.sh, so that shellcheck finds it.  Then, fix:

    In test_succeed line 38:
    this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative"
    ^------------^ SC2034: this_dir_build appears unused. Verify use (or export if used externally).

    In test_succeed line 70:
            local actual_stdout=$(mktemp -t test_debug_info_stdout_actual.XXXXXX)
                  ^-----------^ SC2155: Declare and assign separately to avoid masking return values.

    In test_succeed line 71:
            local actual_stderr=$(mktemp -t test_debug_info_stderr_actual.XXXXXX)
                  ^-----------^ SC2155: Declare and assign separately to avoid masking return values.

    In test_succeed line 72:
            local expected_stdout=$(mktemp -t test_debug_info_stdout_expected.XXXXXX)
                  ^-------------^ SC2155: Declare and assign separately to avoid masking return values.

    In test_succeed line 73:
            local expected_stderr=$(mktemp -t test_debug_info_stderr_expected.XXXXXX)
                  ^-------------^ SC2155: Declare and assign separately to avoid masking return values.

Change-Id: Id9f0d3be21ef215a416946b702f915d98fb539d2
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reported-by: shellcheck
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3136
Tested-by: jenkins <jenkins@lttng.org>
tests/plugins/flt.lttng-utils.debug-info/test_succeed

index 76b299feea1f1308dc76cb9a2e53665f043d1a5f..8a4c07b041c26e60d626c20eedf4475ed2903ab5 100755 (executable)
@@ -31,11 +31,10 @@ else
        UTILSSH="$(dirname "$0")/../../utils/utils.sh"
 fi
 
-# shellcheck source=../../../utils/utils.sh
+# shellcheck source=../../utils/utils.sh
 source "$UTILSSH"
 
 this_dir_relative="plugins/flt.lttng-utils.debug-info"
-this_dir_build="$BT_TESTS_BUILDDIR/$this_dir_relative"
 succeed_trace_dir="$BT_CTF_TRACES_PATH/succeed"
 expect_dir="$BT_TESTS_DATADIR/$this_dir_relative"
 binary_artefact_dir="$BT_TESTS_DATADIR/$this_dir_relative"
@@ -67,12 +66,17 @@ test_compare_to_ctf_fs() {
                "-c" "sink.text.details"
                "--params" "with-trace-name=false,with-stream-name=false,with-uuid=false"
        )
-       local actual_stdout=$(mktemp -t test_debug_info_stdout_actual.XXXXXX)
-       local actual_stderr=$(mktemp -t test_debug_info_stderr_actual.XXXXXX)
-       local expected_stdout=$(mktemp -t test_debug_info_stdout_expected.XXXXXX)
-       local expected_stderr=$(mktemp -t test_debug_info_stderr_expected.XXXXXX)
+       local actual_stdout
+       local actual_stderr
+       local expected_stdout
+       local expected_stderr
        local ret=0
 
+       actual_stdout=$(mktemp -t test_debug_info_stdout_actual.XXXXXX)
+       actual_stderr=$(mktemp -t test_debug_info_stderr_actual.XXXXXX)
+       expected_stdout=$(mktemp -t test_debug_info_stdout_expected.XXXXXX)
+       expected_stderr=$(mktemp -t test_debug_info_stderr_expected.XXXXXX)
+
        # Create expected files using a graph without a `debug-info` component.
        bt_cli "$expected_stdout" "$expected_stderr" "${cli_args[@]}" \
                "${details_cli_args[@]}"
This page took 0.026342 seconds and 4 git commands to generate.