From 8acd5b13cd1fb9117e4cdaaeac474479a646c71f Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 5 Dec 2015 17:47:43 -0800 Subject: [PATCH] Add scripts for running shellcheck/tests interpreted. --- quickrun | 5 +++++ quicktest | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 quickrun create mode 100755 quicktest diff --git a/quickrun b/quickrun new file mode 100755 index 0000000..b9cc753 --- /dev/null +++ b/quickrun @@ -0,0 +1,5 @@ +#!/bin/bash +# quickrun runs ShellCheck in an interpreted mode. +# This allows testing changes without recompiling. + +runghc -idist/build/autogen shellcheck.hs "$@" diff --git a/quicktest b/quicktest new file mode 100755 index 0000000..f4af175 --- /dev/null +++ b/quicktest @@ -0,0 +1,15 @@ +#!/bin/bash +# quicktest runs the ShellCheck unit tests in an interpreted mode. +# This allows running tests without compiling, which can be faster. +# 'cabal test' remains the source of truth. + +( + var=$(echo 'liftM and $ sequence [ShellCheck.Analytics.runTests, ShellCheck.Parser.runTests, ShellCheck.Checker.runTests]' | cabal repl | tee /dev/stderr) +if [[ $var == *$'\nTrue'* ]] +then + exit 0 +else + grep -C 3 "Fail" <<< "$var" + exit 1 +fi +) 2>&1