diff options
author | David Waern <david.waern@gmail.com> | 2008-07-23 23:05:01 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2008-07-23 23:05:01 +0000 |
commit | d5b50a7dd49f692f9acd3026d1183045d4099674 (patch) | |
tree | 405822919bdf5b98bde8c353e913096150787125 | |
parent | 53cae6772f32c57d67cf831982bf7f8a0d715689 (diff) |
Add "all" command to runtests.hs that runs all tests despite failures
-rw-r--r-- | tests/runtests.hs | 7 |
1 files 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 "<A HREF=[^>]*>" False False) f "<A HREF=\"\">" -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) |