-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `cabal check`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. - `cabal build`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” test.
- Loading branch information
Showing
10 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
cabal-testsuite/PackageTests/BuildAutogenPackageGuard/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,10 @@ | ||
# cabal v2-build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- pkg-0 (lib) (first run) | ||
Configuring library for pkg-0... | ||
Error: [Cabal-5559] | ||
To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. | ||
Error: [Cabal-7125] | ||
Failed to build pkg-0-inplace. The failure occurred during the configure step. |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/BuildAutogenPackageGuard/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,2 @@ | ||
packages: . | ||
|
8 changes: 8 additions & 0 deletions
8
cabal-testsuite/PackageTests/BuildAutogenPackageGuard/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,8 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- #9331, guard PackageInfo functionality behind 3.12: make it a | ||
-- build failure. | ||
main = cabalTest $ do | ||
withProjectFile "cabal.project" $ do | ||
fails $ cabal "v2-build" ["pkg"] | ||
|
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/BuildAutogenPackageGuard/pkg.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,17 @@ | ||
cabal-version: 2.4 | ||
name: pkg | ||
version: 0 | ||
license: GPL-3.0-or-later | ||
maintainer: Someone | ||
category: Example | ||
synopsis: Foo | ||
description: FooBar | ||
build-type: Simple | ||
|
||
library | ||
default-language: Haskell2010 | ||
build-depends: base == 4.* | ||
-- ☞ N.B.: PackageInfo packages must contain the same name of | ||
-- of the package! (In this example: `pkg`). | ||
autogen-modules: PackageInfo_pkg | ||
exposed-modules: PackageInfo_pkg |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/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,4 @@ | ||
# cabal check | ||
The package will not build sanely due to these errors: | ||
Error: To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. | ||
Error: Hackage would reject this package. |
6 changes: 6 additions & 0 deletions
6
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/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 | ||
|
||
-- #9331: PackageInfo functionality should be guarded by cabal-version. | ||
main = cabalTest $ | ||
fails $ cabal "check" [] | ||
|
16 changes: 16 additions & 0 deletions
16
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/pkg.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,16 @@ | ||
cabal-version: 2.4 | ||
name: pkg | ||
version: 0 | ||
license: GPL-3.0-or-later | ||
maintainer: Someone | ||
category: Example | ||
synopsis: Foo | ||
description: FooBar | ||
build-type: Simple | ||
|
||
library | ||
default-language: Haskell2010 | ||
build-depends: base <5 | ||
autogen-modules: PackageInfo_pkg | ||
exposed-modules: PackageInfo_pkg | ||
|
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersionOk/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,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersionOk/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,7 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- #9331: PackageInfo functionality should be guarded by cabal-version, | ||
-- does not error when cabal-version is 3.12 or higher. | ||
main = cabalTest $ | ||
cabal "check" [] | ||
|
16 changes: 16 additions & 0 deletions
16
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersionOk/pkg.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,16 @@ | ||
cabal-version: 3.12 | ||
name: pkg | ||
version: 0 | ||
license: GPL-3.0-or-later | ||
maintainer: Someone | ||
category: Example | ||
synopsis: Foo | ||
description: FooBar | ||
build-type: Simple | ||
|
||
library | ||
default-language: Haskell2010 | ||
build-depends: base <5 | ||
autogen-modules: PackageInfo_pkg | ||
exposed-modules: PackageInfo_pkg | ||
|