Merge pull request #2876 from andreasabel/master
Testsuite: report which module failed the tests
This commit is contained in:
commit
175d3cc9b7
|
@ -20,3 +20,4 @@ cabal.config
|
||||||
/parts/
|
/parts/
|
||||||
/prime/
|
/prime/
|
||||||
*.snap
|
*.snap
|
||||||
|
/dist-newstyle/
|
||||||
|
|
|
@ -18,21 +18,24 @@ import qualified ShellCheck.Parser
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
putStrLn "Running ShellCheck tests..."
|
putStrLn "Running ShellCheck tests..."
|
||||||
results <- sequence [
|
failures <- filter (not . snd) <$> mapM sequenceA tests
|
||||||
ShellCheck.Analytics.runTests
|
if null failures then exitSuccess else do
|
||||||
,ShellCheck.AnalyzerLib.runTests
|
putStrLn "Tests failed for the following module(s):"
|
||||||
,ShellCheck.ASTLib.runTests
|
mapM (putStrLn . ("- ShellCheck." ++) . fst) failures
|
||||||
,ShellCheck.CFG.runTests
|
exitFailure
|
||||||
,ShellCheck.CFGAnalysis.runTests
|
where
|
||||||
,ShellCheck.Checker.runTests
|
tests =
|
||||||
,ShellCheck.Checks.Commands.runTests
|
[ ("Analytics" , ShellCheck.Analytics.runTests)
|
||||||
,ShellCheck.Checks.ControlFlow.runTests
|
, ("AnalyzerLib" , ShellCheck.AnalyzerLib.runTests)
|
||||||
,ShellCheck.Checks.Custom.runTests
|
, ("ASTLib" , ShellCheck.ASTLib.runTests)
|
||||||
,ShellCheck.Checks.ShellSupport.runTests
|
, ("CFG" , ShellCheck.CFG.runTests)
|
||||||
,ShellCheck.Fixer.runTests
|
, ("CFGAnalysis" , ShellCheck.CFGAnalysis.runTests)
|
||||||
,ShellCheck.Formatter.Diff.runTests
|
, ("Checker" , ShellCheck.Checker.runTests)
|
||||||
,ShellCheck.Parser.runTests
|
, ("Checks.Commands" , ShellCheck.Checks.Commands.runTests)
|
||||||
|
, ("Checks.ControlFlow" , ShellCheck.Checks.ControlFlow.runTests)
|
||||||
|
, ("Checks.Custom" , ShellCheck.Checks.Custom.runTests)
|
||||||
|
, ("Checks.ShellSupport", ShellCheck.Checks.ShellSupport.runTests)
|
||||||
|
, ("Fixer" , ShellCheck.Fixer.runTests)
|
||||||
|
, ("Formatter.Diff" , ShellCheck.Formatter.Diff.runTests)
|
||||||
|
, ("Parser" , ShellCheck.Parser.runTests)
|
||||||
]
|
]
|
||||||
if and results
|
|
||||||
then exitSuccess
|
|
||||||
else exitFailure
|
|
||||||
|
|
Loading…
Reference in New Issue