aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2017-09-18 01:23:22 +0200
committerDaniel Gröber <dxld@darkboxed.org>2017-09-18 01:35:40 +0200
commitf864a5eae8262752162c6b0d124aea4601ed9ac1 (patch)
tree1b765d25741b6e47d4ad458c8041c0881dd353b8 /tests
parent70d743eb6a8b7f8da182524fa0b2c4bf02399d50 (diff)
Fix literally everything :)
Sorry for the megacommit - Seperate modules into: - Compiletime, modules which are only used while building the package - Runtime, modues included in the wrapper binary to be compiled on the users machine at runtime - Shared, modues used in both contexts - Refactor runtime compilation - Completely revamp output paths - Don't chdir when invoking ghc - Require cabal-version 1.14 in cabal file
Diffstat (limited to 'tests')
-rw-r--r--tests/CompileTest.hs (renamed from tests/Spec.hs)21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/Spec.hs b/tests/CompileTest.hs
index 1487b82..eb10b76 100644
--- a/tests/Spec.hs
+++ b/tests/CompileTest.hs
@@ -10,17 +10,17 @@ import Data.Version
import Data.Functor
import Data.Function
import qualified Distribution.Compat.ReadP as Dist
-import Distribution.Version hiding (Version)
+import Distribution.Version hiding (Version, showVersion)
import Distribution.Text
import Control.Exception as E
import Control.Arrow
import Control.Monad
import Prelude
-import CabalHelper.Common
-import CabalHelper.Compile
-import CabalHelper.Compat.Version
-import CabalHelper.Types
+import CabalHelper.Compiletime.Compat.Version
+import CabalHelper.Compiletime.Compile
+import CabalHelper.Shared.Common
+import CabalHelper.Shared.Types
runReadP'Dist :: Dist.ReadP t t -> String -> t
runReadP'Dist p i = case filter ((=="") . snd) $ Dist.readP_to_S p i of
@@ -135,21 +135,20 @@ compilePrivatePkgDb (Left HEAD) = do
hPutStrLn stderr err
return $ Left $ ExitFailure 1
Right (db, commit) ->
- compileWithPkg "." (Just db) (Left commit)
+ compileWithPkg (Just db) (Left commit)
compilePrivatePkgDb (Right cabalVer) = do
_ <- rawSystem "rm" [ "-r", "/tmp/.ghc-mod" ]
db <- installCabal defaultOptions { verbose = True } cabalVer `E.catch`
\(SomeException _) -> do
errorInstallCabal cabalVer "dist"
- compileWithPkg "." (Just db) (Right cabalVer)
+ compileWithPkg (Just db) (Right cabalVer)
-compileWithPkg :: FilePath
- -> Maybe FilePath
+compileWithPkg :: Maybe FilePath
-> Either String Version
-> IO (Either ExitCode FilePath)
-compileWithPkg chdir mdb ver =
+compileWithPkg mdb ver =
compile "dist" defaultOptions { verbose = True } $
- Compile chdir Nothing mdb ver [cabalPkgId ver]
+ Compile Nothing mdb ver [cabalPkgId ver]
cabalPkgId :: Either String Version -> String
cabalPkgId (Left _commitid) = "Cabal"