Merge pull request #2876 from andreasabel/master

Testsuite: report which module failed the tests
This commit is contained in:
Vidar Holen 2023-12-10 17:34:51 -08:00 committed by GitHub
commit 175d3cc9b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 17 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ cabal.config
/parts/ /parts/
/prime/ /prime/
*.snap *.snap
/dist-newstyle/

View File

@ -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