From d5b50a7dd49f692f9acd3026d1183045d4099674 Mon Sep 17 00:00:00 2001 From: David Waern Date: Wed, 23 Jul 2008 23:05:01 +0000 Subject: Add "all" command to runtests.hs that runs all tests despite failures --- tests/runtests.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/runtests.hs b/tests/runtests.hs index 83c8e75d..ae250164 100644 --- a/tests/runtests.hs +++ b/tests/runtests.hs @@ -20,7 +20,7 @@ haddockEq file1 file2 = (stripLinks file1) == (stripLinks file2) where stripLinks f = subRegex (mkRegexWithOpts "]*>" False False) f "" -check modules = do +check modules strict = do forM_ modules $ \mod -> do let outfile = "output" (dropExtension mod ++ ".html") let reffile = "tests" dropExtension mod ++ ".html.ref" @@ -34,7 +34,7 @@ check modules = do then do putStrLn $ "Output for " ++ mod ++ " has changed! Exiting with diff:" system $ "diff " ++ reffile ++ " " ++ outfile - exitFailure + if strict then exitFailure else return () else do putStrLn $ "Pass: " ++ mod else do @@ -43,6 +43,7 @@ check modules = do test = do contents <- getDirectoryContents "tests" + args <- getArgs let mods = filter ((==) ".hs" . takeExtension) contents let outdir = "output" let mods' = map ("tests" ) mods @@ -51,4 +52,4 @@ test = do -- code <- system $ printf "haddock -w -o %s -h --optghc=-fglasgow-exts --optghc=-w %s" outdir (unwords mods') unless (code == ExitSuccess) $ error "Haddock run failed! Exiting." - check mods + check mods (if not (null args) && args !! 0 == "all" then False else True) -- cgit v1.2.3