diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GhcSession.hs | 7 |
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 |