aboutsummaryrefslogtreecommitdiff
path: root/tests/CompileTest.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-01-14 17:14:12 +0100
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commitefb4ce65962f555ee76533c1089b2c9ebdf4edb5 (patch)
tree8663ca2d726f082d68ea631c3ee0733a763b19cf /tests/CompileTest.hs
parenta543f44bd9541d13d85d9284332705e846c6cb20 (diff)
Refactor 'compileHelper' to cache helper in all cases
Diffstat (limited to 'tests/CompileTest.hs')
-rw-r--r--tests/CompileTest.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/CompileTest.hs b/tests/CompileTest.hs
index e65de8d..dbc033b 100644
--- a/tests/CompileTest.hs
+++ b/tests/CompileTest.hs
@@ -161,18 +161,21 @@ compilePrivatePkgDb eCabalVer = do
res <- E.try $ installCabal defaultOptions { oVerbose = True } eCabalVer
case res of
Right (db, cabalVer) ->
- compileWithPkg (Just db) cabalVer
+ compileWithPkg db cabalVer
Left (ioe :: IOException) -> do
print ioe
return $ Left (ExitFailure 1)
-compileWithPkg :: Maybe PackageDbDir
+compileWithPkg :: PackageDbDir
-> CabalVersion
-> IO (Either ExitCode FilePath)
-compileWithPkg mdb cabalVer =
+compileWithPkg db cabalVer = do
+ appdir <- appCacheDir
+ let comp =
+ CompileWithCabalPackage (Just db) cabalVer [cabalPkgId cabalVer] CPSGlobal
compile
- (CompileWithCabalPackage mdb cabalVer [cabalPkgId cabalVer] CPSGlobal)
- "/does-not-exist"
+ comp
+ (compPaths appdir (error "compile-test: distdir not available") comp)
defaultOptions { oVerbose = True }