Skip to content

Commit a0774dc

Browse files
authored
Merge pull request #9671 from mpickering/wip/cabal-install-Cabal
Use in-tree Cabal library for `cabal-install` tests with custom setup.
2 parents 07f097f + 716b109 commit a0774dc

File tree

21 files changed

+186
-61
lines changed

21 files changed

+186
-61
lines changed

cabal-testsuite/PackageTests/CustomDep/cabal.test.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import Test.Cabal.Prelude
22
main = cabalTest $ do
3-
-- NB: This variant seems to use the bootstrapped Cabal?
4-
skipUnless "no Cabal for GHC" =<< hasCabalForGhc
53
-- implicit setup-depends conflict with GHC >= 8.2; c.f. #415
64
skipUnlessGhcVersion "< 8.2"
75
-- This test depends heavily on what packages are in the global
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Test.Cabal.Prelude
22
main = setupTest $ do
3-
skipUnless "no Cabal for GHC" =<< hasCabalForGhc
43
setup' "configure" [] >>= assertOutputContains "ThisIsCustomYeah"
54
setup' "build" [] >>= assertOutputContains "ThisIsCustomYeah"

cabal-testsuite/PackageTests/CustomPreProcess/cabal.test.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import Test.Cabal.Prelude
22
-- Test internal custom preprocessor
33
main = cabalTest $ do
4-
skipUnless "no Cabal for GHC" =<< hasCabalForGhc
5-
64
-- old Cabal's ./Setup.hs output is difficult to normalise
75
recordMode DoNotRecord $
86
cabal "v2-build" []
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Test.Cabal.Prelude
22
-- Test internal custom preprocessor
33
main = setupTest $ do
4-
skipUnless "no Cabal for GHC" =<< hasCabalForGhc
54
setup_build []
65
runExe' "hello-world" []
76
>>= assertOutputContains "hello from A"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Test.Cabal.Prelude
22
main = setupTest $ do
3+
skipIfGhcVersion "== 7.8.4"
34
recordMode DoNotRecord $ do
4-
skipUnless "no Cabal for GHC" =<< hasCabalForGhc
55
setup' "configure" ["--enable-tests", "--enable-coverage"] >>= assertOutputContains "ThisIsCustomYeah"
66
setup' "build" []
77
setup' "test" [] >>= assertOutputContains "Package coverage report written to"

cabal-testsuite/PackageTests/DuplicateModuleName/setup.test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Test.Cabal.Prelude
22
-- Test that if two components have the same module name, they do not
33
-- clobber each other.
44
main = setupAndCabalTest $ do
5-
skipUnless "no Cabal for GHC" =<< hasCabalForGhc -- use of library test suite
5+
skipIfAllCabalVersion "< 2.2"
66
setup_build ["--enable-tests"]
77
r1 <- fails $ setup' "test" ["foo"]
88
assertOutputContains "test B" r1
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
# cabal v2-update
2-
Downloading the latest package list from test-local-repo
3-
# cabal v2-repl
4-
Resolving dependencies...
5-
Error: [Cabal-7107]
6-
Could not resolve dependencies:
7-
[__0] trying: pkg-a-0 (user goal)
8-
[__1] next goal: pkg-a:setup.Cabal (dependency of pkg-a)
9-
[__1] rejecting: pkg-a:setup.Cabal-<VERSION>/installed-<HASH>, pkg-a:setup.Cabal-3.8.0.0 (constraint from --enable-multi-repl requires >=3.11)
10-
[__1] fail (backjumping, conflict set: pkg-a, pkg-a:setup.Cabal)
11-
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: pkg-a:setup.Cabal (3), pkg-a (2)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Test.Cabal.Prelude
22

3-
main = cabalTest $ withRepo "repo" $ do
3+
main = cabalTest $ recordMode DoNotRecord . withRepo "repo" $ do
4+
-- For the multi-repl command
45
skipUnlessGhcVersion ">= 9.4"
5-
void $ fails $ cabalWithStdin "v2-repl" ["--keep-temp-files","--enable-multi-repl","pkg-a", "pkg-b"] ""
6+
skipUnlessAnyCabalVersion "< 3.11"
7+
res <- fails $ cabalWithStdin "v2-repl" ["--keep-temp-files","--enable-multi-repl","pkg-a", "pkg-b"] ""
8+
assertOutputContains "constraint from --enable-multi-repl requires >=3.11" res
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
# cabal v2-repl
2-
Resolving dependencies...
3-
Error: [Cabal-7107]
4-
Could not resolve dependencies:
5-
[__0] trying: pkg-b-0 (user goal)
6-
[__1] next goal: pkg-b:setup.Cabal (dependency of pkg-b)
7-
[__1] rejecting: pkg-b:setup.Cabal-<VERSION>/installed-<HASH> (constraint from --enable-multi-repl requires >=3.11)
8-
[__1] fail (backjumping, conflict set: pkg-b, pkg-b:setup.Cabal)
9-
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: pkg-b (2), pkg-b:setup.Cabal (2)

cabal-testsuite/PackageTests/MultiRepl/EnabledBadClosure/cabal.test.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import Test.Cabal.Prelude
22

33
main = do
4-
cabalTest $ do
5-
-- MP: TODO: This should query Cabal library version
6-
skipIfGhcVersion ">= 9.10"
4+
cabalTest $ recordMode DoNotRecord $ do
5+
skipUnlessAnyCabalVersion "< 3.11"
76
-- Note: only the last package is interactive.
87
-- this test should load pkg-b too.
98
res <- fails $ cabalWithStdin "v2-repl" ["--enable-multi-repl","pkg-c", "pkg-a"] "Quu.quu"

0 commit comments

Comments
 (0)