浏览代码

tests: Add a shellcheck test

Part of 30065.
teor 5 年之前
父节点
当前提交
ef79e2143e
共有 1 个文件被更改,包括 23 次插入0 次删除
  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 {} +