diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2019-05-26 11:24:47 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-05-30 16:44:08 -0400 |
commit | b7ca94fd43209a62d37506709fad685f09073cc1 (patch) | |
tree | c48e42303b83fe56f882c10e354460aba9b84f2a | |
parent | 99e7276982fe41dca0098e37a9cbf71091c3e275 (diff) | |
download | haskell-b7ca94fd43209a62d37506709fad685f09073cc1.tar.gz |
PartialDownsweep: Add test for import errors
-rw-r--r-- | testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/downsweep/PartialDownsweep.stderr | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs b/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs index fb91fb6c1f..335963be4e 100644 --- a/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs +++ b/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs @@ -8,6 +8,7 @@ import GhcMake import DynFlags import Outputable import Exception (ExceptionMonad, ghandle) +import Bag import Control.Monad import Control.Monad.IO.Class (liftIO) @@ -134,6 +135,17 @@ main = do sort (map (moduleNameString . moduleName . ms_mod) mss) == ["A", "C"] ) + go "Import error" + [ [ "module A where" + , "import B" + , "import DoesNotExist_FooBarBaz" + ] + , [ "module B where" + ] + ] + (\mss -> return $ + sort (map (moduleNameString . moduleName . ms_mod) mss) == ["A", "B"] + ) errored <- readIORef any_failed when errored $ exitFailure @@ -154,6 +166,7 @@ go label mods cnd = hsc_env <- getSession emss <- liftIO $ downsweep hsc_env [] [] False -- liftIO $ hPutStrLn stderr $ showSDocUnsafe $ ppr $ rights emss + -- liftIO $ hPrint stderr $ bagToList $ unionManyBags $ lefts emss it label $ cnd (rights emss) diff --git a/testsuite/tests/ghc-api/downsweep/PartialDownsweep.stderr b/testsuite/tests/ghc-api/downsweep/PartialDownsweep.stderr index 9e5f6d83dc..14c1b6c19a 100644 --- a/testsuite/tests/ghc-api/downsweep/PartialDownsweep.stderr +++ b/testsuite/tests/ghc-api/downsweep/PartialDownsweep.stderr @@ -13,3 +13,4 @@ B.hs:2:0: error: error: #elif without #if #elif <- cpp error here +== Import error |