mirror of
				https://github.com/koalaman/shellcheck.git
				synced 2025-11-01 07:29:51 +08:00 
			
		
		
		
	Merge pull request #2876 from andreasabel/master
Testsuite: report which module failed the tests
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -20,3 +20,4 @@ cabal.config | ||||
| /parts/ | ||||
| /prime/ | ||||
| *.snap | ||||
| /dist-newstyle/ | ||||
|   | ||||
| @@ -18,21 +18,24 @@ import qualified ShellCheck.Parser | ||||
|  | ||||
| main = do | ||||
|     putStrLn "Running ShellCheck tests..." | ||||
|     results <- sequence [ | ||||
|         ShellCheck.Analytics.runTests | ||||
|         ,ShellCheck.AnalyzerLib.runTests | ||||
|         ,ShellCheck.ASTLib.runTests | ||||
|         ,ShellCheck.CFG.runTests | ||||
|         ,ShellCheck.CFGAnalysis.runTests | ||||
|         ,ShellCheck.Checker.runTests | ||||
|         ,ShellCheck.Checks.Commands.runTests | ||||
|         ,ShellCheck.Checks.ControlFlow.runTests | ||||
|         ,ShellCheck.Checks.Custom.runTests | ||||
|         ,ShellCheck.Checks.ShellSupport.runTests | ||||
|         ,ShellCheck.Fixer.runTests | ||||
|         ,ShellCheck.Formatter.Diff.runTests | ||||
|         ,ShellCheck.Parser.runTests | ||||
|     failures <- filter (not . snd) <$> mapM sequenceA tests | ||||
|     if null failures then exitSuccess else do | ||||
|       putStrLn "Tests failed for the following module(s):" | ||||
|       mapM (putStrLn . ("- ShellCheck." ++) . fst) failures | ||||
|       exitFailure | ||||
|   where | ||||
|     tests = | ||||
|       [ ("Analytics"          , ShellCheck.Analytics.runTests) | ||||
|       , ("AnalyzerLib"        , ShellCheck.AnalyzerLib.runTests) | ||||
|       , ("ASTLib"             , ShellCheck.ASTLib.runTests) | ||||
|       , ("CFG"                , ShellCheck.CFG.runTests) | ||||
|       , ("CFGAnalysis"        , ShellCheck.CFGAnalysis.runTests) | ||||
|       , ("Checker"            , ShellCheck.Checker.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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user