From c169867cabd97bbdb445b04010f7ededc9e3f2c3 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 2 Aug 2022 15:40:58 -0400 Subject: [PATCH] tests: fix shellcheck warnings in plugins/sink.ctf.fs Fix: In test_stream_names line 43: echo "Created CTF trace \`$(cygpath -m ${temp_output_dir})\\trace\`." > "$temp_expected_stdout" ^-- SC2028 (info): echo may not expand escape sequences. Use printf. ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "Created CTF trace \`$(cygpath -m "${temp_output_dir}")\\trace\`." > "$temp_expected_stdout" In test_assume_single_trace line 41: echo "Created CTF trace \`$(cygpath -m ${trace_dir})\`." > "$temp_expected_stdout" ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "Created CTF trace \`$(cygpath -m "${trace_dir}")\`." > "$temp_expected_stdout" Change-Id: I483ce2ba6c35c2ca191bf5ca1352ac97a0a9c157 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/8637 --- tests/plugins/sink.ctf.fs/test_assume_single_trace | 2 +- tests/plugins/sink.ctf.fs/test_stream_names | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/plugins/sink.ctf.fs/test_assume_single_trace b/tests/plugins/sink.ctf.fs/test_assume_single_trace index 6af7aa05..69dfb362 100755 --- a/tests/plugins/sink.ctf.fs/test_assume_single_trace +++ b/tests/plugins/sink.ctf.fs/test_assume_single_trace @@ -38,7 +38,7 @@ ok "$?" "run sink.ctf.fs with assume-single-trace=true" # Check stdout. if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then - echo "Created CTF trace \`$(cygpath -m ${trace_dir})\`." > "$temp_expected_stdout" + echo "Created CTF trace \`$(cygpath -m "${trace_dir}")\`." > "$temp_expected_stdout" else echo "Created CTF trace \`${trace_dir}\`." > "$temp_expected_stdout" fi diff --git a/tests/plugins/sink.ctf.fs/test_stream_names b/tests/plugins/sink.ctf.fs/test_stream_names index c071eb17..e5993c7d 100755 --- a/tests/plugins/sink.ctf.fs/test_stream_names +++ b/tests/plugins/sink.ctf.fs/test_stream_names @@ -40,7 +40,8 @@ ok "$?" "run babeltrace" # Check stdout. if [ "$BT_TESTS_OS_TYPE" = "mingw" ]; then - echo "Created CTF trace \`$(cygpath -m ${temp_output_dir})\\trace\`." > "$temp_expected_stdout" + # shellcheck disable=SC2028 + echo "Created CTF trace \`$(cygpath -m "${temp_output_dir}")\\trace\`." > "$temp_expected_stdout" else echo "Created CTF trace \`${trace_dir}\`." > "$temp_expected_stdout" fi -- 2.34.1