Skip to content

Commit

Permalink
Add --version-win option to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 24, 2023
1 parent 2619733 commit 16a2b24
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 11 deletions.
19 changes: 19 additions & 0 deletions cabal-testsuite/PackageTests/VersionPriority/0-local.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Error: [Cabal-7107]
Expand All @@ -10,3 +11,21 @@ Could not resolve dependencies:
[__1] rejecting: hashable-1.4.2.0 (constraint from project config ProjectConfigImport {importDepth = 0, importPath = "<ROOT>/0-local.project"} requires ==1.4.3.0)
[__1] fail (backjumping, conflict set: cabal-version-override, hashable)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), cabal-version-override (2)
# --version-win=shallowest
# cabal v2-build
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: cabal-version-override-0.1.0.0 (user goal)
[__1] next goal: hashable (dependency of cabal-version-override)
[__1] rejecting: hashable-1.4.3.0 (constraint from project config ProjectConfigImport {importDepth = 0, importPath = "<ROOT>/0-local.project"} requires ==1.4.2.0)
[__1] rejecting: hashable-1.4.2.0 (constraint from project config ProjectConfigImport {importDepth = 0, importPath = "<ROOT>/0-local.project"} requires ==1.4.3.0)
[__1] fail (backjumping, conflict set: cabal-version-override, hashable)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), cabal-version-override (2)
# --version-win=latest
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
10 changes: 8 additions & 2 deletions cabal-testsuite/PackageTests/VersionPriority/0-local.test.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import Test.Cabal.Prelude

main = cabalTest . withRepo "repo" . withProjectFile "0-local.project" $ do
fails $ cabal "v2-build" ["--dry-run"]
main = cabalTest . withRepo "repo" . withProjectFile "0-local.project" . recordMode RecordMarked $ do
let log = recordHeader . pure
log "--version-win not supplied, default"
fails $ cabal "v2-build" ["--dry-run"]
log "--version-win=shallowest"
fails $ cabal "v2-build" ["--dry-run", "--version-win=shallowest"]
log "--version-win=latest"
cabal "v2-build" ["--dry-run", "--version-win=latest"]
14 changes: 14 additions & 0 deletions cabal-testsuite/PackageTests/VersionPriority/1-local.out
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=shallowest
# cabal v2-build
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=latest
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- hashable-1.4.3.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
10 changes: 8 additions & 2 deletions cabal-testsuite/PackageTests/VersionPriority/1-local.test.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import Test.Cabal.Prelude

main = cabalTest . withRepo "repo" . withProjectFile "1-local.project" $ do
cabal "v2-build" ["--dry-run"]
main = cabalTest . withRepo "repo" . withProjectFile "1-local.project" . recordMode RecordMarked $ do
let log = recordHeader . pure
log "--version-win not supplied, default"
cabal "v2-build" ["--dry-run"]
log "--version-win=shallowest"
cabal "v2-build" ["--dry-run", "--version-win=shallowest"]
log "--version-win=latest"
cabal "v2-build" ["--dry-run", "--version-win=latest"]
14 changes: 14 additions & 0 deletions cabal-testsuite/PackageTests/VersionPriority/1-web.out
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-9.6.3 -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=shallowest
# cabal v2-build
Build profile: -w ghc-9.6.3 -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=latest
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-9.6.3 -O1
In order, the following would be built:
- hashable-1.4.3.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
8 changes: 7 additions & 1 deletion cabal-testsuite/PackageTests/VersionPriority/1-web.test.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import Test.Cabal.Prelude

main = cabalTest . withRepo "repo" . withProjectFile "1-web.project" $ do
main = cabalTest . withRepo "repo" . withProjectFile "1-web.project" . recordMode RecordMarked $ do
-- To avoid this diff:
-- -Build profile: -w ghc-9.6.3 -O1
-- +Build profile: -w ghc-<GHCVER> -O1
skipIfGhcVersion "== 9.6.3"
let log = recordHeader . pure
log "--version-win not supplied, default"
cabal "v2-build" ["--dry-run"]
log "--version-win=shallowest"
cabal "v2-build" ["--dry-run", "--version-win=shallowest"]
log "--version-win=latest"
cabal "v2-build" ["--dry-run", "--version-win=latest"]
14 changes: 14 additions & 0 deletions cabal-testsuite/PackageTests/VersionPriority/2-local.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=shallowest
# cabal v2-build
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=latest
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
Expand Down
10 changes: 8 additions & 2 deletions cabal-testsuite/PackageTests/VersionPriority/2-local.test.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import Test.Cabal.Prelude

main = cabalTest . withRepo "repo" . withProjectFile "2-local.project" $ do
cabal "v2-build" ["--dry-run"]
main = cabalTest . withRepo "repo" . withProjectFile "2-local.project" . recordMode RecordMarked $ do
let log = recordHeader . pure
log "--version-win not supplied, default"
cabal "v2-build" ["--dry-run"]
log "--version-win=shallowest"
cabal "v2-build" ["--dry-run", "--version-win=shallowest"]
log "--version-win=latest"
cabal "v2-build" ["--dry-run", "--version-win=latest"]
14 changes: 14 additions & 0 deletions cabal-testsuite/PackageTests/VersionPriority/2-web.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-9.6.3 -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=shallowest
# cabal v2-build
Build profile: -w ghc-9.6.3 -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=latest
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-9.6.3 -O1
Expand Down
10 changes: 8 additions & 2 deletions cabal-testsuite/PackageTests/VersionPriority/2-web.test.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import Test.Cabal.Prelude

main = cabalTest . withRepo "repo" . withProjectFile "2-web.project" $ do
main = cabalTest . withRepo "repo" . withProjectFile "2-web.project" . recordMode RecordMarked $ do
-- To avoid this diff:
-- -Build profile: -w ghc-9.6.3 -O1
-- +Build profile: -w ghc-<GHCVER> -O1
skipIfGhcVersion "== 9.6.3"
cabal "v2-build" ["--dry-run"]
let log = recordHeader . pure
log "--version-win not supplied, default"
cabal "v2-build" ["--dry-run"]
log "--version-win=shallowest"
cabal "v2-build" ["--dry-run", "--version-win=shallowest"]
log "--version-win=latest"
cabal "v2-build" ["--dry-run", "--version-win=latest"]
14 changes: 14 additions & 0 deletions cabal-testsuite/PackageTests/VersionPriority/3-web.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-9.6.3 -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=shallowest
# cabal v2-build
Build profile: -w ghc-9.6.3 -O1
In order, the following would be built:
- hashable-1.4.2.0 (lib) (requires build)
- cabal-version-override-0.1.0.0 (exe:cabal-version-override) (first run)
# --version-win=latest
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-9.6.3 -O1
Expand Down
10 changes: 8 additions & 2 deletions cabal-testsuite/PackageTests/VersionPriority/3-web.test.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import Test.Cabal.Prelude

main = cabalTest . withRepo "repo" . withProjectFile "3-web.project" $ do
main = cabalTest . withRepo "repo" . withProjectFile "3-web.project" . recordMode RecordMarked $ do
-- To avoid this diff:
-- -Build profile: -w ghc-9.6.3 -O1
-- +Build profile: -w ghc-<GHCVER> -O1
skipIfGhcVersion "== 9.6.3"
cabal "v2-build" ["--dry-run"]
let log = recordHeader . pure
log "--version-win not supplied, default"
cabal "v2-build" ["--dry-run"]
log "--version-win=shallowest"
cabal "v2-build" ["--dry-run", "--version-win=shallowest"]
log "--version-win=latest"
cabal "v2-build" ["--dry-run", "--version-win=latest"]

0 comments on commit 16a2b24

Please sign in to comment.