-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a regression test for issue #4288.
- Loading branch information
Showing
7 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module CustomIssue where | ||
|
||
f x = x + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import SetupHelper (setupHelperDefaultMain) | ||
|
||
main = setupHelperDefaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: T4288 | ||
version: 1.0 | ||
build-type: Custom | ||
|
||
-- cabal-version is lower than the version of Cabal that will be chosen for the | ||
-- setup script. | ||
cabal-version: >=1.10 | ||
|
||
-- Setup script only has a transitive dependency on Cabal. | ||
custom-setup | ||
setup-depends: base, setup-helper | ||
|
||
library | ||
exposed-modules: CustomIssue | ||
build-depends: base | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages: . setup-helper/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- This test is similar to the simplified example in issue #4288. The package's | ||
-- setup script only depends on base and setup-helper. setup-helper exposes a | ||
-- function that is a wrapper for Cabal's defaultMain (similar to | ||
-- cabal-doctest). This test builds the package to check that the flags passed | ||
-- to the setup script are compatible with the version of Cabal that it depends | ||
-- on, even though Cabal is only a transitive dependency. | ||
main = cabalTest $ do | ||
skipUnless =<< hasNewBuildCompatBootCabal | ||
r <- recordMode DoNotRecord $ cabal' "new-build" ["T4288"] | ||
assertOutputContains "This is setup-helper-1.0." r | ||
assertOutputContains | ||
("In order, the following will be built: " | ||
++ " - setup-helper-1.0 (lib:setup-helper) (first run) " | ||
++ " - T4288-1.0 (lib:T4288) (first run)") | ||
r |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/SetupHelper.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module SetupHelper (setupHelperDefaultMain) where | ||
|
||
import Distribution.Simple | ||
|
||
setupHelperDefaultMain = putStrLn "This is setup-helper-1.0." >> defaultMain |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/setup-helper.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: setup-helper | ||
version: 1.0 | ||
build-type: Simple | ||
cabal-version: >= 1.2 | ||
|
||
library | ||
exposed-modules: SetupHelper | ||
build-depends: base, Cabal | ||
default-language: Haskell2010 |