-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for
default-package-bounds
- Loading branch information
Showing
12 changed files
with
136 additions
and
1 deletion.
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
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
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/DefaultPackageBounds/bar/Main.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 Main where | ||
|
||
main = pure () |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/DefaultPackageBounds/bar/bar.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,7 @@ | ||
cabal-version: 3.14 | ||
name: bar | ||
version: 0.1.0.0 | ||
|
||
executable bar | ||
default-language: Haskell2010 | ||
main-is: Main.hs |
31 changes: 31 additions & 0 deletions
31
cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out
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,31 @@ | ||
# cabal build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following would be built: | ||
- bar-0.1.0.0 (exe:bar) (first run) | ||
- foo-0.1.0.0 (lib) (first run) | ||
# cabal build | ||
Resolving dependencies... | ||
Error: [Cabal-7107] | ||
Could not resolve dependencies: | ||
[__0] trying: foo-0.1.0.0 (user goal) | ||
[__1] rejecting: foo:-build-depends-conflict (constraint from config file, command line flag, or user target requires opposite flag selection) | ||
[__1] trying: foo:+build-depends-conflict | ||
[__2] next goal: time (dependency of foo +/-build-depends-conflict) | ||
[__2] rejecting: time-<VERSION>/installed-<HASH> (conflict: foo +build-depends-conflict => time<0) | ||
[__2] fail (backjumping, conflict set: foo, time, foo:build-depends-conflict) | ||
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: foo (4), foo:build-depends-conflict (3), time (2) | ||
# cabal build | ||
Resolving dependencies... | ||
Error: [Cabal-7107] | ||
Could not resolve dependencies: | ||
[__0] trying: bar-0.1.0.0 (user goal) | ||
[__1] trying: foo-0.1.0.0 (user goal) | ||
[__2] rejecting: foo:-build-tool-conflict (constraint from config file, command line flag, or user target requires opposite flag selection) | ||
[__2] trying: foo:+build-tool-conflict | ||
[__3] next goal: foo:bar:exe.bar (dependency of foo +/-build-tool-conflict) | ||
[__3] rejecting: foo:bar:exe.bar~>bar-0.1.0.0 (conflict: foo +build-tool-conflict => foo:bar:exe.bar (exe bar)<0) | ||
[__3] rejecting: foo:bar:exe.bar-0.1.0.0 (multiple instances) | ||
[__3] fail (backjumping, conflict set: bar, foo, foo:bar:exe.bar, foo:build-tool-conflict) | ||
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: foo (4), foo:bar:exe.bar (3), foo:build-tool-conflict (3), bar (2) | ||
Try running with --minimize-conflict-set to improve the error message. |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project
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: . bar |
6 changes: 6 additions & 0 deletions
6
cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.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,6 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest $ withProjectFile "cabal.project" $ do | ||
cabal "build" ["foo", "--dry-run"] | ||
fails $ cabal "build" ["foo", "-fbuild-depends-conflict"] | ||
fails $ cabal "build" ["foo", "-fbuild-tool-conflict"] |
31 changes: 31 additions & 0 deletions
31
cabal-testsuite/PackageTests/DefaultPackageBounds/foo.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,31 @@ | ||
cabal-version: 3.14 | ||
name: foo | ||
version: 0.1.0.0 | ||
|
||
default-package-bounds: | ||
, time <0 | ||
, bar:bar <0 | ||
|
||
flag build-depends-conflict | ||
manual: True | ||
default: False | ||
description: cause conflict | ||
|
||
flag build-tool-conflict | ||
manual: True | ||
default: False | ||
description: cause conflict | ||
|
||
library | ||
if flag(build-depends-conflict) | ||
build-depends: | ||
time | ||
else | ||
build-depends: | ||
time >0 | ||
default-language: Haskell2010 | ||
|
||
if flag(build-tool-conflict) | ||
build-tool-depends: bar:bar | ||
else | ||
build-tool-depends: bar:bar >0 |
14 changes: 14 additions & 0 deletions
14
cabal-testsuite/PackageTests/DefaultPackageBoundsAllowNewer/cabal.out
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,14 @@ | ||
# cabal build | ||
Resolving dependencies... | ||
Error: [Cabal-7107] | ||
Could not resolve dependencies: | ||
[__0] trying: foo-0.1.0.0 (user goal) | ||
[__1] next goal: time (dependency of foo) | ||
[__1] rejecting: time-<VERSION>/installed-<HASH> (conflict: foo => time<1) | ||
[__1] fail (backjumping, conflict set: foo, time) | ||
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: foo (3), time (2) | ||
# cabal build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following would be built: | ||
- foo-0.1.0.0 (lib) (first run) |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/DefaultPackageBoundsAllowNewer/cabal.test.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 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest $ do | ||
fails $ cabal "build" ["foo", "--dry-run"] | ||
cabal "build" ["foo", "--dry-run", "--allow-newer"] |
18 changes: 18 additions & 0 deletions
18
cabal-testsuite/PackageTests/DefaultPackageBoundsAllowNewer/foo.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,18 @@ | ||
cabal-version: 3.14 | ||
name: foo | ||
version: 0.1.0.0 | ||
license: BSD-3-Clause | ||
license-file: LICENSE | ||
author: Javier Sagredo | ||
maintainer: [email protected] | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
|
||
default-package-bounds: | ||
time <1 | ||
|
||
library | ||
build-depends: base | ||
, time | ||
hs-source-dirs: src | ||
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