aboutsummaryrefslogtreecommitdiff
path: root/haddock-test
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2018-03-02 16:20:19 +0100
committeralexbiehl <alex.biehl@gmail.com>2018-03-02 16:22:38 +0100
commit58a73575d10cfe8f18c63e886e7cb53ccbcb65cd (patch)
treeea2c6be7f6f59886dc795cc692f09088ba32df64 /haddock-test
parent1ac2f9569242f6cb074ba6e577285a4c33ae1197 (diff)
haddock-test: Be more explicit which packages to pass
We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files.
Diffstat (limited to 'haddock-test')
-rw-r--r--haddock-test/src/Test/Haddock/Config.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/haddock-test/src/Test/Haddock/Config.hs b/haddock-test/src/Test/Haddock/Config.hs
index 2d16fa63..8b395b6c 100644
--- a/haddock-test/src/Test/Haddock/Config.hs
+++ b/haddock-test/src/Test/Haddock/Config.hs
@@ -197,6 +197,7 @@ loadConfig ccfg dcfg flags files = do
[ pure ["--no-warnings"]
, pure ["--odir=" ++ dcfgOutDir dcfg]
, pure ["--optghc=-w"]
+ , pure ["--optghc=-hide-all-packages"]
, pure $ flagsHaddockOptions flags
, baseDependencies ghcPath
]
@@ -244,13 +245,21 @@ baseDependencies ghcPath = do
#else
pkgIndex <- getInstalledPackages normal [GlobalPackageDB] cfg
#endif
- mapM (getDependency pkgIndex) ["base", "process", "ghc-prim"]
+ let
+ pkgs =
+ [ "array"
+ , "base"
+ , "ghc-prim"
+ , "process"
+ , "template-haskell"
+ ]
+ concat `fmap` mapM (getDependency pkgIndex) pkgs
where
getDependency pkgIndex name = case ifaces pkgIndex name of
[] -> do
hPutStrLn stderr $ "Couldn't find base test dependency: " ++ name
exitFailure
- (ifArg:_) -> pure ifArg
+ (ifArg:_) -> pure ["--optghc=-package" ++ name, ifArg]
ifaces pkgIndex name = do
pkg <- join $ snd <$> lookupPackageName pkgIndex (mkPackageName name)
iface <$> haddockInterfaces pkg <*> haddockHTMLs pkg