aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CompileTest.hs6
-rw-r--r--tests/GhcSession.hs34
-rw-r--r--tests/custom-setup/Lib.hs8
-rw-r--r--tests/custom-setup/Setup.hs2
-rw-r--r--tests/custom-setup/custom-setup.cabal13
-rw-r--r--tests/custom-setup/packages.list1
-rw-r--r--tests/custom-setup/stack.yaml3
7 files changed, 56 insertions, 11 deletions
diff --git a/tests/CompileTest.hs b/tests/CompileTest.hs
index 02580f8..e77e3de 100644
--- a/tests/CompileTest.hs
+++ b/tests/CompileTest.hs
@@ -155,11 +155,11 @@ testCabalVersions versions = do
mcabalVersions <- runMaybeT $ listCabalVersions (Just db)
case mcabalVersions of
Just [hdver] ->
- return $ che0 (CabalVersion hdver) (Just db)
+ return $ che0 (CabalVersion hdver) [db]
_ ->
- return $ che0 (CabalHEAD ()) Nothing
+ return $ che0 (CabalHEAD ()) []
(CabalVersion ver) ->
- return $ che0 (CabalVersion ver) Nothing
+ return $ che0 (CabalVersion ver) []
compileHelper che
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs
index a4e7d62..c776164 100644
--- a/tests/GhcSession.hs
+++ b/tests/GhcSession.hs
@@ -2,8 +2,8 @@
DataKinds, ExistentialQuantification, PolyKinds, ViewPatterns,
DeriveFunctor, MonoLocalBinds, GADTs, MultiWayIf #-}
-{-| This test ensures we can get a GHC API session up and running in a variety of
- project environments.
+{-| This test ensures we can get a GHC API session up and running in a
+ variety of project environments.
-}
module Main where
@@ -126,13 +126,31 @@ main = do
-- fucking awesome store cache to keep CI times down.
--
-- TODO: Better test coverage for helper compilation with the other two!
- [ TC (TN "exelib") (parseVer "1.10") (parseVer "0") []
- , TC (TN "exeintlib") (parseVer "2.0") (parseVer "0") []
- , TC (TN "fliblib") (parseVer "2.0") (parseVer "0") []
- , TC (TN "bkpregex") (parseVer "2.0") (parseVer "8.1") [Cabal CV2, Cabal CV1]
- , TC (TN "src-repo") (parseVer "2.4") (parseVer "0") [Cabal CV2]
+ [ TC (TN "exelib") (parseVer "1.10") (parseVer "0") []
+ , TC (TN "exeintlib") (parseVer "2.0") (parseVer "0") []
+ , TC (TN "fliblib") (parseVer "2.0") (parseVer "0") []
+ , TC (TN "custom-setup") (parseVer "1.24") (parseVer "0") [Cabal CV2, Stack]
+ -- ^ Custom setup has issues in v1. Specifically we can get into the
+ -- situation where v1-configure --with-ghc=... will pick one Cabal
+ -- lib version but then v1-build (without --with-ghc) will pick
+ -- another because the system ghc has different packages available
+ -- than the --with-ghc one.
+ --
+ -- At this point a setup recompile happens and hell breaks loose
+ -- because setup-config is mismatched. The reason we can't just pass
+ -- --with-ghc to v1-build to fix this is that it will actually ignore
+ -- it as far as setup compilation is concerned while v1-configure
+ -- will pick it up.
+ --
+ -- We could fuck around with $PATH in the v1-build case too but I
+ -- really don't think that many people use v1 still and with
+ -- built-type:custom no less.
+ --
+ -- See haskell/cabal#6749
+ , TC (TN "bkpregex") (parseVer "2.0") (parseVer "8.1") [Cabal CV2, Cabal CV1]
+ , TC (TN "src-repo") (parseVer "2.4") (parseVer "0") [Cabal CV2]
, let multipkg_loc = TF "tests/multipkg/" "proj/" "proj/proj.cabal" in
- TC multipkg_loc (parseVer "1.10") (parseVer "0") [Cabal CV2, Stack]
+ TC multipkg_loc (parseVer "1.10") (parseVer "0") [Cabal CV2, Stack]
-- min Cabal lib ver -^ min GHC ver -^
]
diff --git a/tests/custom-setup/Lib.hs b/tests/custom-setup/Lib.hs
new file mode 100644
index 0000000..417a0ad
--- /dev/null
+++ b/tests/custom-setup/Lib.hs
@@ -0,0 +1,8 @@
+module Lib where
+
+import System.Directory
+import System.FilePath
+
+filepath = "a" </> "b"
+directory = doesFileExist "Exe.hs"
+foo = 1
diff --git a/tests/custom-setup/Setup.hs b/tests/custom-setup/Setup.hs
new file mode 100644
index 0000000..9a994af
--- /dev/null
+++ b/tests/custom-setup/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/tests/custom-setup/custom-setup.cabal b/tests/custom-setup/custom-setup.cabal
new file mode 100644
index 0000000..63410ac
--- /dev/null
+++ b/tests/custom-setup/custom-setup.cabal
@@ -0,0 +1,13 @@
+name: custom-setup
+version: 0
+build-type: Custom
+cabal-version: >=1.10
+extra-source-files: stack.yaml
+
+custom-setup
+ setup-depends: base, Cabal
+
+library
+ exposed-modules: Lib
+ build-depends: base, filepath, directory
+ default-language: Haskell2010
diff --git a/tests/custom-setup/packages.list b/tests/custom-setup/packages.list
new file mode 100644
index 0000000..80e52ce
--- /dev/null
+++ b/tests/custom-setup/packages.list
@@ -0,0 +1 @@
+./
diff --git a/tests/custom-setup/stack.yaml b/tests/custom-setup/stack.yaml
new file mode 100644
index 0000000..27cc995
--- /dev/null
+++ b/tests/custom-setup/stack.yaml
@@ -0,0 +1,3 @@
+resolver: lts-0.0 # will be overridden on the commandline
+packages:
+- ./