[PATCH] perf test perftool_testsuite: Add missing shellcheck source directive

Nicolas Schier posted 1 patch 1 month, 1 week ago
There is a newer version of this series
tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh | 1 +
tools/perf/tests/shell/base_probe/test_adding_kernel.sh      | 1 +
tools/perf/tests/shell/base_probe/test_basic.sh              | 1 +
tools/perf/tests/shell/base_probe/test_invalid_options.sh    | 1 +
tools/perf/tests/shell/base_probe/test_line_semantics.sh     | 1 +
tools/perf/tests/shell/base_report/setup.sh                  | 1 +
tools/perf/tests/shell/base_report/test_basic.sh             | 1 +
7 files changed, 7 insertions(+)
[PATCH] perf test perftool_testsuite: Add missing shellcheck source directive
Posted by Nicolas Schier 1 month, 1 week ago
Add shellcheck source directive to prevent shellcheck SC1090 warning
like:

    In tests/shell/base_probe/test_line_semantics.sh line 20:
    . "$DIR_PATH/../common/init.sh"
      ^---------------------------^ SC1090: Can't follow non-constant source. Use a directive to specify location.

Fixes: 241f21be7d0f ("perf test perftool_testsuite: Use absolute paths")
Signed-off-by: Nicolas Schier <n.schier@avm.de>
---
 tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh | 1 +
 tools/perf/tests/shell/base_probe/test_adding_kernel.sh      | 1 +
 tools/perf/tests/shell/base_probe/test_basic.sh              | 1 +
 tools/perf/tests/shell/base_probe/test_invalid_options.sh    | 1 +
 tools/perf/tests/shell/base_probe/test_line_semantics.sh     | 1 +
 tools/perf/tests/shell/base_report/setup.sh                  | 1 +
 tools/perf/tests/shell/base_report/test_basic.sh             | 1 +
 7 files changed, 7 insertions(+)

diff --git a/tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh b/tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh
index f74aab5c5d7f85b04f68090515acdfa49b6bccf3..06fca7d2cbb407eaea57df79bef11e26b49f9841 100755
--- a/tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh
+++ b/tools/perf/tests/shell/base_probe/test_adding_blacklisted.sh
@@ -17,6 +17,7 @@ DIR_PATH="$(dirname $0)"
 TEST_RESULT=0
 
 # include working environment
+# shellcheck source=tests/shell/common/init.sh
 . "$DIR_PATH/../common/init.sh"
 
 # skip if not supported
diff --git a/tools/perf/tests/shell/base_probe/test_adding_kernel.sh b/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
index 555a825d55f24543e3b6d105660c2cb505080e04..b6f9c4a697921b232a4795afcba10882e6101ce9 100755
--- a/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
+++ b/tools/perf/tests/shell/base_probe/test_adding_kernel.sh
@@ -17,6 +17,7 @@ DIR_PATH="$(dirname $0)"
 TEST_RESULT=0
 
 # include working environment
+# shellcheck source=tests/shell/common/init.sh
 . "$DIR_PATH/../common/init.sh"
 
 # shellcheck source=lib/probe_vfs_getname.sh
diff --git a/tools/perf/tests/shell/base_probe/test_basic.sh b/tools/perf/tests/shell/base_probe/test_basic.sh
index 162838ddc974d04d806b22366866f8201802f969..f2db48cb9b8feffc6de1f3ea50a1dc99cb44f377 100755
--- a/tools/perf/tests/shell/base_probe/test_basic.sh
+++ b/tools/perf/tests/shell/base_probe/test_basic.sh
@@ -16,6 +16,7 @@ DIR_PATH="$(dirname $0)"
 TEST_RESULT=0
 
 # include working environment
+# shellcheck source=tests/shell/common/init.sh
 . "$DIR_PATH/../common/init.sh"
 
 if ! check_kprobes_available; then
diff --git a/tools/perf/tests/shell/base_probe/test_invalid_options.sh b/tools/perf/tests/shell/base_probe/test_invalid_options.sh
index 44a3ae014bfa2ffa831b86796b2e5187311d7303..3ae9afe6288b04d90777ebf5cdc64342f270eb75 100755
--- a/tools/perf/tests/shell/base_probe/test_invalid_options.sh
+++ b/tools/perf/tests/shell/base_probe/test_invalid_options.sh
@@ -16,6 +16,7 @@ DIR_PATH="$(dirname $0)"
 TEST_RESULT=0
 
 # include working environment
+# shellcheck source=tests/shell/common/init.sh
 . "$DIR_PATH/../common/init.sh"
 
 if ! check_kprobes_available; then
diff --git a/tools/perf/tests/shell/base_probe/test_line_semantics.sh b/tools/perf/tests/shell/base_probe/test_line_semantics.sh
index 576442d87a44400a65edce95b23070ce56f32993..4a1189c6cb0cbc269672c47efa617d20b0b4e795 100755
--- a/tools/perf/tests/shell/base_probe/test_line_semantics.sh
+++ b/tools/perf/tests/shell/base_probe/test_line_semantics.sh
@@ -17,6 +17,7 @@ DIR_PATH="$(dirname $0)"
 TEST_RESULT=0
 
 # include working environment
+# shellcheck source=tests/shell/common/init.sh
 . "$DIR_PATH/../common/init.sh"
 
 if ! check_kprobes_available; then
diff --git a/tools/perf/tests/shell/base_report/setup.sh b/tools/perf/tests/shell/base_report/setup.sh
index bb49b0fabb11499d4fb20d3c8c325d7f081cf18b..bc1dd8c128a6a57fd0a8ba94e51f0b11453a31de 100755
--- a/tools/perf/tests/shell/base_report/setup.sh
+++ b/tools/perf/tests/shell/base_report/setup.sh
@@ -15,6 +15,7 @@
 DIR_PATH="$(dirname $0)"
 
 # include working environment
+# shellcheck source=tests/shell/common/init.sh
 . "$DIR_PATH/../common/init.sh"
 
 TEST_RESULT=0
diff --git a/tools/perf/tests/shell/base_report/test_basic.sh b/tools/perf/tests/shell/base_report/test_basic.sh
index 0dfe7e5fd1ca609535fa70b03c8301373ec3fe6f..4cbc7c67f7bb9ccd79f950b731c604a426c5bfd0 100755
--- a/tools/perf/tests/shell/base_report/test_basic.sh
+++ b/tools/perf/tests/shell/base_report/test_basic.sh
@@ -16,6 +16,7 @@ DIR_PATH="$(dirname $0)"
 TEST_RESULT=0
 
 # include working environment
+# shellcheck source=tests/shell/common/init.sh
 . "$DIR_PATH/../common/init.sh"
 
 

---
base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578
change-id: 20251229-perf-add-shellcheck-sc1090-annotation-fec8beb43c1e

Best regards,
-- 
Nicolas Schier