aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2009-08-16 00:37:52 +0000
committerDavid Waern <david.waern@gmail.com>2009-08-16 00:37:52 +0000
commitaaf26e5243f376d5503ca8c4221f03224c18af1d (patch)
treea54facf16bf1bfba47d76208cace674c9340ca3c /tests
parent7f4130af50264254efa0b6c22be83b078b63d798 (diff)
Read base.haddock when running tests
We can now test cross-package docs.
Diffstat (limited to 'tests')
-rw-r--r--tests/runtests.hs9
1 files changed, 8 insertions, 1 deletions
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)