Fix tests more

This commit is contained in:
Daniel Gröber
2015-09-14 07:11:45 +02:00
parent ba14e1790c
commit 55f278853a
2 changed files with 22 additions and 4 deletions

View File

@@ -69,9 +69,14 @@ withGhcModEnv' withCradle dir opts f =
c <- gmoChan <$> gmoAsk
gbracket_ (liftIO $ forkIO $ stdoutGateway c) (liftIO . killThread) a
withCradleRootDir (cradleRootDir -> projdir) =
gbracket_ (liftIO $ setCurrentDirectory projdir >> getCurrentDirectory)
(liftIO . setCurrentDirectory)
withCradleRootDir (cradleRootDir -> projdir) a =
gbracket_ (liftIO $ swapCurrentDirectory projdir)
(liftIO . setCurrentDirectory) a
swapCurrentDirectory ndir = do
odir <- canonicalizePath =<< getCurrentDirectory
setCurrentDirectory ndir
return odir
gbracket_ ma mb mc = gbracket ma mb (const mc)