Browse Source

tests: Add a shellcheck test

Part of 30065.
teor 5 years ago
parent
commit
ef79e2143e
1 changed files with 23 additions and 0 deletions
  1. 23 0
      tests/shellcheck-tests.sh

+ 23 - 0
tests/shellcheck-tests.sh

@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Exit on errors
+set -e
+# Verbose mode
+set -v
+
+
+# Output is prefixed with the name of the script
+myname=$(basename "$0")
+
+echo "$myname: finding chutney directory"
+TEST_DIR=$(dirname "$0")
+CHUTNEY_DIR=$(dirname "$TEST_DIR")
+
+echo "$myname: changing to chutney directory"
+cd "$CHUTNEY_DIR"
+
+
+echo "$myname: running shellcheck tests"
+
+shellcheck chutney
+find . -name "*.sh" -exec shellcheck {} +