From: Nathaniel Wesley Filardo Date: Tue, 18 Jun 2013 18:36:57 +0000 (-0400) Subject: Hack in a workaround for hanging the test harness X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=d711ab5e68c0f99e883ab84e8cd98bfa1c08cc1f;p=dyna2 Hack in a workaround for hanging the test harness Catch the thrown ExitFailure and just return () --- diff --git a/src/Dyna/Backend/Python/Selftest.hs b/src/Dyna/Backend/Python/Selftest.hs index 99db414..f130c31 100644 --- a/src/Dyna/Backend/Python/Selftest.hs +++ b/src/Dyna/Backend/Python/Selftest.hs @@ -4,10 +4,11 @@ -- Header material {{{ {-# LANGUAGE ImplicitParams #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module Dyna.Backend.Python.Selftest where -import Control.Exception (throw) +import Control.Exception (handle,throw) import qualified Dyna.Backend.Python.Backend as DP import qualified Dyna.Main.Driver as D import System.Directory (removeFile) @@ -23,11 +24,11 @@ import Test.Golden ------------------------------------------------------------------------}}} -- Run Backend {{{ --- XXX There's something wrong here -- if we encounter an ExitFailure and --- throw an exception, we fail to fail the test or even time out. This --- might be my fault, or it might be upstream. runDynaPy :: FilePath -> FilePath -> FilePath -> IO () -runDynaPy f pl out = do + +-- XXX this 'handle' thing is pretty hackish, but it does stop us from +-- breaking the test harness. +runDynaPy f pl out = handle (\(_ :: ExitCode) -> return ()) $ do _ <- tryIOError $ removeFile pl _ <- tryIOError $ removeFile out