Commit 85e92fab authored by Benno Fünfstück's avatar Benno Fünfstück Committed by Edward Z. Yang
Browse files

fixup! cabal-testsuite: test that configure failure is treated as failed

parent 6cfe3652
......@@ -2,9 +2,10 @@
import Test.Cabal.Prelude
import Data.IORef
import Control.Monad.IO.Class
import Control.Monad.Catch
import Control.Exception (ErrorCall)
import qualified Control.Monad.Catch as Catch
main = setupTest $ do
-- the following is a hack to check that `setup configure` indeed
-- fails: all tests use `assertFailure` which uses `error` if the fail
......@@ -14,7 +15,7 @@ main = setupTest $ do
-- That's not what we want. So `fails (return ())` for example succeeds, even though
-- `return ()` doesn't fail.
succeededRef <- liftIO $ newIORef True
setup "configure" [] `catch` \(_ :: ErrorCall) ->
setup "configure" [] `Catch.catch` \(_ :: ErrorCall) ->
liftIO $ writeIORef succeededRef False
succeeded <- liftIO $ readIORef succeededRef
assertBool "test should have failed, but succeeded instead (configure exits with failure)" $ not succeeded
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment