Fix: tests: add shellcheck test to distribution
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 16 Feb 2023 16:37:10 +0000 (11:37 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Feb 2023 16:16:02 +0000 (11:16 -0500)
Add the shellcheck test to the distribution, also copy it to the build
dir for oot builds and while where are here, rename it with the 'test_'
prefix to match the rest of the test suite.

Change-Id: Iaeff191022d16ea666c2145aa7e907aeebb6c5ff
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/meta/Makefile.am
tests/meta/shellcheck-tests [deleted file]
tests/meta/test_shellcheck [new file with mode: 0755]

index 044fc83c991ec0bbcf0a67d858a1aa476b43b9a8..becce81378ac7c0fe74d43c9dc7a189a1c200ca1 100644 (file)
@@ -4,4 +4,20 @@ LOG_DRIVER_FLAGS = --merge
 LOG_DRIVER = env PGREP='$(PGREP)' AM_TAP_AWK='$(AWK)' $(SHELL) \
                $(top_srcdir)/tests/utils/tap-driver.sh
 
-TESTS = shellcheck-tests
+TESTS = test_shellcheck
+
+EXTRA_DIST = $(TESTS)
+
+all-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(EXTRA_DIST); do \
+                       cp -f $(srcdir)/$$script $(builddir); \
+               done; \
+       fi
+
+clean-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(EXTRA_DIST); do \
+                       rm -f $(builddir)/$$script; \
+               done; \
+       fi
diff --git a/tests/meta/shellcheck-tests b/tests/meta/shellcheck-tests
deleted file mode 100755 (executable)
index 49c8e73..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/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/shellcheck-tests
-    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
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.027526 seconds and 4 git commands to generate.