From 8ac2f87d8328554fc66331282d8b1c169e430ac5 Mon Sep 17 00:00:00 2001 From: David Waern Date: Mon, 6 Jul 2009 20:14:57 +0000 Subject: Wibble --- tests/runtests.hs | 8 ++++---- 1 file 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 "]*>" False False) f "" + 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) -- cgit v1.2.3