show doctest failures on stderr, less verbose make doctest
This commit is contained in:
		
							parent
							
								
									1bc8f8430f
								
							
						
					
					
						commit
						5e08ad821e
					
				
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| @ -111,8 +111,8 @@ unittest: | ||||
| 
 | ||||
| # run doc tests
 | ||||
| doctest: tools/doctest | ||||
| 	@(tools/doctest Commands/Add.hs \
 | ||||
| 		&& tools/doctest Tests.hs \
 | ||||
| 	@(tools/doctest Commands/Add.hs >/dev/null \
 | ||||
| 		&& tools/doctest Tests.hs >/dev/null \
 | ||||
| 		&& echo $@ passed) || echo $@ FAILED | ||||
| 
 | ||||
| # make sure we have no haddock errors
 | ||||
|  | ||||
| @ -31,7 +31,7 @@ module Main where | ||||
| import Data.List (isPrefixOf) | ||||
| import System (getArgs) | ||||
| import System.Exit (ExitCode(ExitSuccess)) | ||||
| import System.IO (hGetContents) | ||||
| import System.IO (hGetContents, hPutStr, hPutStrLn, stderr) | ||||
| import System.Process (runInteractiveCommand, waitForProcess) | ||||
| import Text.Printf (printf) | ||||
| 
 | ||||
| @ -56,10 +56,10 @@ runShellDocTest s = do | ||||
|           putStrLn "ok" | ||||
|           return True | ||||
|         else do | ||||
|           putStr $ printf "FAILED\nExpected:\n%sGot:\n%s" expected output | ||||
|           hPutStr stderr $ printf "FAILED\nExpected:\n%sGot:\n%s" expected output | ||||
|           return False | ||||
|     else do | ||||
|       putStrLn $ printf "ERROR: %s" (show exit) | ||||
|       hPutStrLn stderr $ printf "ERROR: %s" (show exit) | ||||
|       return False | ||||
| 
 | ||||
| splitDocTest s = (strip $ drop 1 $ strip $ head ls, unlines $ tail ls) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user