[commit: haddock] ghc-7.6: Extend rather than set environment when running HTML tests (dd6209a)

Simon Hengel <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/dd6209a0a1adf9f2817075173cca99ac2379db2e

>---------------------------------------------------------------

commit dd6209a0a1adf9f2817075173cca99ac2379db2e
Author: Simon Hengel <[email protected]>
Date:   Sun Oct 7 16:44:06 2012 +0200

    Extend rather than set environment when running HTML tests
    
    On some platforms (e.g. ppc64) GHC requires gcc in the path.

>---------------------------------------------------------------

 tests/html-tests/runtests.hs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs
index 25e53d1..fc9477c 100644
--- a/tests/html-tests/runtests.hs
+++ b/tests/html-tests/runtests.hs
@@ -43,15 +43,19 @@ test = do
           _ -> filter ((==) ".hs" . takeExtension) contents
 
   let mods' = map (testDir </>) mods
+
+  env_ <- getEnvironment
+  let env = Just (("haddock_datadir", packageRoot) : env_)
+
   putStrLn ""
   putStrLn "Haddock version: "
   h1 <- runProcess haddockPath ["--version"] Nothing
-                   (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing
+                   env Nothing Nothing Nothing
   waitForProcess h1
   putStrLn ""
   putStrLn "GHC version: "
   h2 <- runProcess haddockPath ["--ghc-version"] Nothing
-                   (Just [("haddock_datadir", packageRoot)]) Nothing Nothing Nothing
+                   env Nothing Nothing Nothing
   waitForProcess h2
   putStrLn ""
 
@@ -77,7 +81,7 @@ test = do
   handle <- runProcess haddockPath
                        (["-w", "-o", outDir, "-h", "--pretty-html", "--optghc=-fglasgow-exts"
                         , "--optghc=-w", base, process, ghcprim] ++ opts ++ mods')
-                       Nothing (Just [("haddock_datadir", packageRoot)]) Nothing
+                       Nothing env Nothing
                        Nothing Nothing
 
   code <- waitForProcess handle
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.