Commit e666eaaa authored by kristenk's avatar kristenk
Browse files

Update regression test for issue #3436 after #4909.

#4909 changed the cabal-version of the package under test, so this commit
adjusts the versions of the Cabal libraries in the test to be consistent with
the cabal-version.
parent bf3414e2
......@@ -2,8 +2,8 @@
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- Cabal-99999 (lib:Cabal) (first run)
- Cabal-2.0 (lib:Cabal) (first run)
- custom-setup-1.0 (lib:custom-setup) (first run)
Configuring Cabal-99999...
Preprocessing library for Cabal-99999..
Building library for Cabal-99999..
Configuring Cabal-2.0...
Preprocessing library for Cabal-2.0..
Building library for Cabal-2.0..
packages: custom-setup Cabal-99999
packages: custom-setup Cabal-2.0
import Test.Cabal.Prelude
main = cabalTest $ do
-- NB: This test doesn't really test #3436, because Cabal-99998
-- NB: This test doesn't really test #3436, because Cabal-1.2
-- isn't in the system database and thus we can't see if the
-- depsolver incorrectly chooses it. Worth fixing if we figure
-- out how to simulate the "global" database without root.
r <- fails $ cabal' "new-build" ["custom-setup"]
assertOutputContains "This is Cabal-99999" r
assertOutputContains "This is Cabal-2.0" r
......@@ -4,6 +4,6 @@ version: 1.0
build-type: Custom
custom-setup
setup-depends: base, Cabal >= 99999
setup-depends: base, Cabal >= 2.0
library
......@@ -3,19 +3,19 @@ Writing a default package environment file to <ROOT>/sandbox.dist/cabal.sandbox.
Creating a new sandbox at <ROOT>/sandbox.dist/sandbox
# cabal install
Resolving dependencies...
Configuring Cabal-99998...
Preprocessing library for Cabal-99998..
Building library for Cabal-99998..
Configuring Cabal-1.2...
Preprocessing library for Cabal-1.2..
Building library for Cabal-1.2..
Installing library in <PATH>
Installed Cabal-99998
Installed Cabal-1.2
# cabal sandbox add-source
# cabal install
Resolving dependencies...
Configuring Cabal-99999...
Preprocessing library for Cabal-99999..
Building library for Cabal-99999..
Configuring Cabal-2.0...
Preprocessing library for Cabal-2.0..
Building library for Cabal-2.0..
Installing library in <PATH>
Installed Cabal-99999
Installed Cabal-2.0
Failed to install custom-setup-1.0
cabal: Error: some packages failed to install:
custom-setup-1.0-92JpsxIMpiQHysxYdDtEVq failed during the configure step. The exception was:
......
import Test.Cabal.Prelude
-- Regression test for issue #3436
--
-- #3436 occurred when a package with a custom setup specified a 'cabal-version'
-- that was newer than the version of the installed Cabal library, even though
-- the solver didn't choose the installed Cabal for the package's setup script.
--
-- This test installs a fake Cabal-1.2 and then tries to build the package
-- custom-setup, which depends on a fake Cabal-2.0 (through cabal-version and
-- setup-depends).
main = cabalTest $ do
withSandbox $ do
cabal "install" ["./Cabal-99998"]
cabal_sandbox "add-source" ["Cabal-99999"]
cabal "install" ["./Cabal-1.2"]
cabal_sandbox "add-source" ["Cabal-2.0"]
-- Install custom-setup, which has a setup dependency on Cabal-99999.
-- cabal should build the setup script with Cabal-99999, but then
-- configure should fail because Setup just prints an error message
-- cabal should build custom-setup's setup script with Cabal-2.0, but
-- then configure should fail because Setup just prints an error message
-- imported from Cabal and exits.
r <- fails $ cabal' "install" ["custom-setup/"]
assertOutputContains "This is Cabal-99999" r
assertOutputContains "This is Cabal-2.0" r
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment