From aaf26e5243f376d5503ca8c4221f03224c18af1d Mon Sep 17 00:00:00 2001 From: David Waern Date: Sun, 16 Aug 2009 00:37:52 +0000 Subject: Read base.haddock when running tests We can now test cross-package docs. --- tests/runtests.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/runtests.hs b/tests/runtests.hs index 9aa27871..dd5a84f6 100644 --- a/tests/runtests.hs +++ b/tests/runtests.hs @@ -8,6 +8,8 @@ import Data.List import Control.Monad import Text.Printf import Text.Regex +import Distribution.Simple.Utils +import Distribution.Verbosity main = do @@ -56,8 +58,13 @@ test = do h2 <- runProcess "../dist/build/haddock/haddock" ["--ghc-version"] Nothing (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing waitForProcess h2 putStrLn "" + + libdir <- rawSystemStdout normal "../dist/build/haddock/haddock" ["--print-ghc-libdir"] + let basepath = init libdir ++ "/../../share/doc/ghc/libraries/base/" + let option = "-i " ++ basepath ++ "," ++ basepath ++ "base.haddock" + putStrLn "Running tests..." - handle <- runProcess "../dist/build/haddock/haddock" (["-w", "-o", outdir, "-h", "--optghc=-fglasgow-exts", "--optghc=-w"] ++ mods') Nothing (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing + handle <- runProcess "../dist/build/haddock/haddock" (["-w", "-o", outdir, "-h", "--optghc=-fglasgow-exts", "--optghc=-w", option] ++ mods') Nothing (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing code <- waitForProcess handle 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