From 5e08ad821e6a9f9c20d0051bd22a10e44dcee0a2 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 5 Jun 2009 18:59:59 +0000 Subject: [PATCH] show doctest failures on stderr, less verbose make doctest --- Makefile | 4 ++-- tools/doctest.hs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 342c38c31..44a5d8c43 100644 --- a/Makefile +++ b/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 diff --git a/tools/doctest.hs b/tools/doctest.hs index 116122f4d..af57737a6 100644 --- a/tools/doctest.hs +++ b/tools/doctest.hs @@ -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)