aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src/Test
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2017-04-18 16:45:32 +0200
committerAlex Biehl <alexbiehl@gmail.com>2017-04-25 10:08:48 +0200
commit70885ce16e1b0b9bf19fe0efb85a48daa0e5c281 (patch)
tree97616aa480ce473386bc6f7cf2d58d8f74ac28f1 /haddock-test/src/Test
parent99ec96e57ea6b002394c923201d46a67ecfb8e16 (diff)
Travis: Use ghc-8.2.1 on master
Diffstat (limited to 'haddock-test/src/Test')
-rw-r--r--haddock-test/src/Test/Haddock/Config.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/haddock-test/src/Test/Haddock/Config.hs b/haddock-test/src/Test/Haddock/Config.hs
index e1e920f2..50616c7f 100644
--- a/haddock-test/src/Test/Haddock/Config.hs
+++ b/haddock-test/src/Test/Haddock/Config.hs
@@ -165,11 +165,18 @@ loadConfig ccfg dcfg flags files = do
cfgEnv <- (:) ("haddock_datadir", dcfgResDir dcfg) <$> getEnvironment
systemHaddockPath <- List.lookup "HADDOCK_PATH" <$> getEnvironment
- cfgHaddockPath <- case flagsHaddockPath flags <|> systemHaddockPath of
+ haddockOnPath <- findExecutable "haddock"
+
+ let haddock_path = msum [ flagsHaddockPath flags
+ , systemHaddockPath
+ , haddockOnPath
+ ]
+
+ cfgHaddockPath <- case haddock_path of
Just path -> pure path
- Nothing -> do
- hPutStrLn stderr $ "Haddock executable not specified"
- exitFailure
+ Nothing -> do
+ hPutStrLn stderr "Haddock executable not found"
+ exitFailure
ghcPath <- init <$> rawSystemStdout normal cfgHaddockPath
["--print-ghc-path"]
@@ -195,7 +202,7 @@ loadConfig ccfg dcfg flags files = do
let cfgAccept = FlagAccept `elem` flags
let cfgCheckConfig = ccfg
- let cfgDirConfig = dcfg
+ let cfgDirConfig = dcfg
return $ Config { .. }