Improve online docs for `includes:` field
[cabal.git] / cabal-testsuite / PackageTests / BuildTargets / UseLocalPackageForSetup / use-local-package-as-setup-dep.test.hs
blob35011eee42ebeeb51fb64a03303f6bf0eb090ad1
1 import Test.Cabal.Prelude
3 -- This test case is a simplified version of #4295. There is a local package,
4 -- pkg-1.0, which has a setup dependency on setup-dep==2.*. The repo contains
5 -- setup-dep-1.0, and the project contains the newer version, setup-dep-2.0.
6 -- pkg-1.0 also has a non-setup dependency on setup-dep==1.*.
7 --
8 -- The solution to the dependency problem must use the local setup-dep only as a
9 -- setup dependency for pkg. This means that setup-dep cannot use the same
10 -- qualifier as pkg, even though they are both build targets of the project.
11 -- The solution must use --independent-goals to give pkg and setup-dep different
12 -- qualifiers.
13 main =
14 cabalTest $ withShorterPathForNewBuildStore $ do
15 skipUnless "no v2-build compatible boot-Cabal" =<< hasNewBuildCompatBootCabal
16 withRepo "repo" $ do
17 fails $ cabal "v2-build" ["pkg:my-exe", "--dry-run"]
18 -- Disabled recording because whether or not we get
19 -- detailed information for the build of my-exe depends
20 -- on whether or not the Cabal library version is recent
21 -- enough
22 r1 <- recordMode DoNotRecord $ cabal' "v2-build" ["pkg:my-exe", "--independent-goals"]
23 assertOutputContains "Setup.hs: setup-dep from project" r1
24 withPlan $ do
25 r2 <- runPlanExe' "pkg" "my-exe" []
26 assertOutputContains "Main.hs: setup-dep from repo" r2