Fix quicktest, add note to it and quickrun
This commit is contained in:
parent
9e7539c10b
commit
5516596b26
7
quickrun
7
quickrun
|
@ -3,3 +3,10 @@
|
|||
# This allows testing changes without recompiling.
|
||||
|
||||
runghc -isrc -idist/build/autogen shellcheck.hs "$@"
|
||||
|
||||
# Note: with new-build you can
|
||||
#
|
||||
# % cabal new-run --disable-optimization -- shellcheck "$@"
|
||||
#
|
||||
# This does build the executable, but as the optimisation is disabled,
|
||||
# the build is quite fast.
|
||||
|
|
37
quicktest
37
quicktest
|
@ -1,22 +1,21 @@
|
|||
#!/bin/bash
|
||||
# quicktest runs the ShellCheck unit tests in an interpreted mode.
|
||||
# This allows running tests without compiling, which can be faster.
|
||||
# shellcheck disable=SC2091
|
||||
|
||||
# quicktest runs the ShellCheck unit tests.
|
||||
# Once `doctests` test executable is build, we can just run it
|
||||
# This allows running tests without compiling library, which is faster.
|
||||
# 'cabal test' remains the source of truth.
|
||||
|
||||
(
|
||||
var=$(echo 'liftM and $ sequence [
|
||||
ShellCheck.Analytics.runTests
|
||||
,ShellCheck.Parser.runTests
|
||||
,ShellCheck.Checker.runTests
|
||||
,ShellCheck.Checks.Commands.runTests
|
||||
,ShellCheck.Checks.ShellSupport.runTests
|
||||
,ShellCheck.AnalyzerLib.runTests
|
||||
]' | tr -d '\n' | cabal repl 2>&1 | tee /dev/stderr)
|
||||
if [[ $var == *$'\nTrue'* ]]
|
||||
then
|
||||
exit 0
|
||||
else
|
||||
grep -C 3 -e "Fail" -e "Tracing" <<< "$var"
|
||||
exit 1
|
||||
fi
|
||||
) 2>&1
|
||||
$(find dist -type f -name doctests)
|
||||
|
||||
# Note: if you have build the project with new-build
|
||||
#
|
||||
# % cabal new-build -w ghc-8.4.3 --enable-tests
|
||||
#
|
||||
# and have cabal-plan installed (e.g. with cabal new-install cabal-plan),
|
||||
# then you can quicktest with
|
||||
#
|
||||
# % $(cabal-plan list-bin doctests)
|
||||
#
|
||||
# Once the test executable exists, we can simply run it to perform doctests
|
||||
# which use GHCi under the hood.
|
||||
|
|
Loading…
Reference in New Issue