aboutsummaryrefslogtreecommitdiff
path: root/tests/runtests.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2009-07-06 20:14:57 +0000
committerDavid Waern <david.waern@gmail.com>2009-07-06 20:14:57 +0000
commit8ac2f87d8328554fc66331282d8b1c169e430ac5 (patch)
treefe23334d7173fd9477112c880326e5317bc5d5d2 /tests/runtests.hs
parente9fece5ba5249c02123c616589640f664b63f041 (diff)
Wibble
Diffstat (limited to 'tests/runtests.hs')
-rw-r--r--tests/runtests.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/runtests.hs b/tests/runtests.hs
index 1c1edd39..27c1506c 100644
--- a/tests/runtests.hs
+++ b/tests/runtests.hs
@@ -16,16 +16,17 @@ main = do
putStrLn "All tests passed!"
-haddockEq file1 file2 = (stripLinks file1) == (stripLinks file2)
+haddockEq file1 file2 = stripLinks file1 == stripLinks file2
where
stripLinks f = subRegex (mkRegexWithOpts "<A HREF=[^>]*>" False False) f "<A HREF=\"\">"
+
check modules strict = do
forM_ modules $ \mod -> do
let outfile = "output" </> (dropExtension mod ++ ".html")
let reffile = "tests" </> dropExtension mod ++ ".html.ref"
b <- doesFileExist reffile
- if b
+ if b
then do
copyFile reffile ("output" </> takeFileName reffile)
out <- readFile outfile
@@ -39,7 +40,7 @@ check modules strict = do
putStrLn $ "Pass: " ++ mod
else do
putStrLn $ "Pass: " ++ mod ++ " (no .ref file)"
-
+
test = do
contents <- getDirectoryContents "tests"
@@ -51,7 +52,6 @@ test = do
runProcess "../dist/build/haddock/haddock" ["--ghc-version"] Nothing (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing
handle <- runProcess "../dist/build/haddock/haddock" (["-w", "-o", outdir, "-h", "--optghc=-fglasgow-exts", "--optghc=-w"] ++ mods') Nothing (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing
code <- waitForProcess handle
-
-- code <- system $ printf "haddock -w -o %s -h --optghc=-fglasgow-exts --optghc=-w %s" outdir (unwords mods')
when (code /= ExitSuccess) $ error "Haddock run failed! Exiting."
check mods (if not (null args) && args !! 0 == "all" then False else True)