diff --git a/cabal-testsuite/PackageTests/NewBuild/T4288/CustomIssue.hs b/cabal-testsuite/PackageTests/NewBuild/T4288/CustomIssue.hs new file mode 100644 index 00000000000..b19db66b19c --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/T4288/CustomIssue.hs @@ -0,0 +1,3 @@ +module CustomIssue where + +f x = x + 1 diff --git a/cabal-testsuite/PackageTests/NewBuild/T4288/Setup.hs b/cabal-testsuite/PackageTests/NewBuild/T4288/Setup.hs new file mode 100644 index 00000000000..c98988c966b --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/T4288/Setup.hs @@ -0,0 +1,3 @@ +import SetupHelper (setupHelperDefaultMain) + +main = setupHelperDefaultMain diff --git a/cabal-testsuite/PackageTests/NewBuild/T4288/T4288.cabal b/cabal-testsuite/PackageTests/NewBuild/T4288/T4288.cabal new file mode 100644 index 00000000000..eaa6fc71bac --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/T4288/T4288.cabal @@ -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 diff --git a/cabal-testsuite/PackageTests/NewBuild/T4288/cabal.project b/cabal-testsuite/PackageTests/NewBuild/T4288/cabal.project new file mode 100644 index 00000000000..2c65bdcb6c8 --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/T4288/cabal.project @@ -0,0 +1 @@ +packages: . setup-helper/ diff --git a/cabal-testsuite/PackageTests/NewBuild/T4288/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/T4288/cabal.test.hs new file mode 100644 index 00000000000..dc15d37a5bc --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/T4288/cabal.test.hs @@ -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 diff --git a/cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/SetupHelper.hs b/cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/SetupHelper.hs new file mode 100644 index 00000000000..0d71dd0570d --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/SetupHelper.hs @@ -0,0 +1,5 @@ +module SetupHelper (setupHelperDefaultMain) where + +import Distribution.Simple + +setupHelperDefaultMain = putStrLn "This is setup-helper-1.0." >> defaultMain diff --git a/cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/setup-helper.cabal b/cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/setup-helper.cabal new file mode 100644 index 00000000000..eb3570e04cd --- /dev/null +++ b/cabal-testsuite/PackageTests/NewBuild/T4288/setup-helper/setup-helper.cabal @@ -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