Fix: tests: add shellcheck test to distribution
[lttng-tools.git] / tests / meta / test_shellcheck
diff --git a/tests/meta/test_shellcheck b/tests/meta/test_shellcheck
new file mode 100755 (executable)
index 0000000..3806dad
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (c) 2023 Olivier Dion <odion@efficios.com>
+
+# Augment this list incrementally when a shell script passes shellcheck.
+#
+# All file must be relative to the test directory.
+files=(
+    meta/test_shellcheck
+    run.sh
+)
+
+TESTDIR=$(dirname "$0")/..
+
+# shellcheck source=../utils/tap/tap.sh
+source "$TESTDIR/utils/tap/tap.sh"
+
+function shellcheck_ok() {
+    shellcheck --external-sources "$1"
+    ok $? "Checking $1"
+}
+
+plan_tests "${#files[@]}"
+
+for f in "${files[@]}";
+do
+    shellcheck_ok "$TESTDIR/$f"
+done
This page took 0.023168 seconds and 4 git commands to generate.