aboutsummaryrefslogtreecommitdiff
path: root/tests/GhcSession.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2017-12-02 14:52:57 +0100
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commit49dca6e8963a8fcd4e30d76d65068e9fa76a4a8d (patch)
tree706d4504ab751a2953375a3f0903b511951af94e /tests/GhcSession.hs
parentd1307ef4b6ad38ec4574e5d3631d34e97bdef86c (diff)
ghc-session: Make tests fail on warnings
Diffstat (limited to 'tests/GhcSession.hs')
-rw-r--r--tests/GhcSession.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs
index bbd6bfb..0deefca 100644
--- a/tests/GhcSession.hs
+++ b/tests/GhcSession.hs
@@ -88,9 +88,10 @@ test dir = do
let qe = mkQueryEnv dir (dir </> "dist")
cs <- runQuery qe $ components $ (,,) <$> entrypoints <.> ghcOptions
forM cs $ \(ep, opts, cn) -> do
- let sopts = intercalate " " $ map formatArg $ "ghc" : opts
+ let opts' = "-Werror" : opts
+ let sopts = intercalate " " $ map formatArg $ "ghc" : opts'
putStrLn $ "\n" ++ show cn ++ ": " ++ sopts
- compileModule ep opts
+ compileModule ep opts'
where
formatArg x
| "-" `isPrefixOf` x = "\n "++x
@@ -109,6 +110,8 @@ compileModule ep opts = do
runGhc (Just libdir) $ do
+ handleSourceError (\e -> GHC.printException e >> return False) $ do
+
dflags0 <- getSessionDynFlags
let dflags1 = dflags0 {
ghcMode = CompManager