-
Notifications
You must be signed in to change notification settings - Fork 697
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 #9799 about freeze qualifying all packages with 'any' constraint scope.
- Loading branch information
Showing
37 changed files
with
171 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Revision history for T9799 | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
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 @@ | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
main = _ |
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,15 @@ | ||
cabal-version: 3.0 | ||
name: T9799 | ||
version: 0.1.0.0 | ||
license: NONE | ||
build-type: Custom | ||
extra-doc-files: CHANGELOG.md | ||
|
||
custom-setup | ||
setup-depends: libA == 0.2.0.0 | ||
|
||
library | ||
exposed-modules: MyLib | ||
build-depends: libA == 0.1.0.0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ do | ||
withRepo "repo" . withSourceCopy $ do | ||
cabal "v2-freeze" [] | ||
cwd <- fmap testCurrentDir getTestEnv | ||
-- Guarantee that freeze writes scope-qualified constraints, not 'any' | ||
-- qualified constraints. | ||
assertFileDoesNotContain (cwd </> "cabal.project.freeze") "any.libA" | ||
assertFileDoesContain (cwd </> "cabal.project.freeze") "setup.libA == 0.2.0.0" |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Freeze/T9799a/repo/libA-0.1.0.0/CHANGELOG.md
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 @@ | ||
# Revision history for libA0100 | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/Freeze/T9799a/repo/libA-0.1.0.0/libA.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,11 @@ | ||
cabal-version: 3.0 | ||
name: libA | ||
version: 0.1.0.0 | ||
license: NONE | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
|
||
library | ||
exposed-modules: MyLib | ||
hs-source-dirs: src | ||
default-language: Haskell2010 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Freeze/T9799a/repo/libA-0.1.0.0/src/MyLib.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,4 @@ | ||
module MyLib (someFunc) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Freeze/T9799a/repo/libA-0.2.0.0/CHANGELOG.md
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 @@ | ||
# Revision history for libA0100 | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/Freeze/T9799a/repo/libA-0.2.0.0/libA.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,11 @@ | ||
cabal-version: 3.0 | ||
name: libA | ||
version: 0.2.0.0 | ||
license: NONE | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
|
||
library | ||
exposed-modules: MyLib | ||
hs-source-dirs: src | ||
default-language: Haskell2010 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Freeze/T9799a/repo/libA-0.2.0.0/src/MyLib.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,4 @@ | ||
module MyLib (someFunc) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |
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 @@ | ||
module MyLib (someFunc) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |
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 @@ | ||
# Revision history for T9799 | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
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 MyLib | ||
import Distribution.Simple | ||
main = do | ||
putStrLn $ "Setup: " ++ vers | ||
defaultMain |
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,15 @@ | ||
cabal-version: 3.0 | ||
name: T9799 | ||
version: 0.1.0.0 | ||
license: NONE | ||
build-type: Custom | ||
extra-doc-files: CHANGELOG.md | ||
|
||
custom-setup | ||
setup-depends: libA, base, Cabal | ||
|
||
library | ||
exposed-modules: None | ||
build-depends: libA, base, template-haskell | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ do | ||
withRepo "repo" . withSourceCopy $ do | ||
|
||
-- Show how using 'any' qualifiers always with relaxed bounds can violate that | ||
-- cabal freeze --constraint=... && cabal build | ||
-- should be equal to | ||
-- cabal build --constraint=... | ||
-- | ||
-- Therefore, the packages in a cabal.project.freeze file must be properly qualified | ||
|
||
out1 <- cabal' "v2-build" ["--constraint='setup.libA == 0.1.0.0'"] | ||
assertOutputContains "Setup: libA-0.1.0.0" out1 | ||
assertOutputContains "Build: libA-0.2.0.0" out1 | ||
|
||
cabal "v2-freeze" ["--constraint=setup.libA == 0.1.0.0'"] | ||
out2 <- cabal' "v2-build" [] | ||
assertOutputContains "Setup: libA-0.1.0.0" out2 | ||
assertOutputContains "Building: libA-0.2.0.0" out2 |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Freeze/T9799b/repo/libA-0.1.0.0/CHANGELOG.md
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 @@ | ||
# Revision history for libA0100 | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/Freeze/T9799b/repo/libA-0.1.0.0/libA.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,12 @@ | ||
cabal-version: 3.0 | ||
name: libA | ||
version: 0.1.0.0 | ||
license: NONE | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
|
||
library | ||
exposed-modules: MyLib | ||
build-depends: base | ||
hs-source-dirs: src | ||
default-language: Haskell2010 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Freeze/T9799b/repo/libA-0.1.0.0/src/MyLib.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,4 @@ | ||
module MyLib where | ||
|
||
vers :: String | ||
vers = "libA-0.1.0.0" |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Freeze/T9799b/repo/libA-0.2.0.0/CHANGELOG.md
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 @@ | ||
# Revision history for libA0100 | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/Freeze/T9799b/repo/libA-0.2.0.0/libA.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,12 @@ | ||
cabal-version: 3.0 | ||
name: libA | ||
version: 0.2.0.0 | ||
license: NONE | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
|
||
library | ||
exposed-modules: MyLib | ||
build-depends: base | ||
hs-source-dirs: src | ||
default-language: Haskell2010 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Freeze/T9799b/repo/libA-0.2.0.0/src/MyLib.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,4 @@ | ||
module MyLib where | ||
|
||
renamedVers :: String | ||
renamedVers = "libA-0.2.0.0" |
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 @@ | ||
{-# LANGUAGE TemplateHaskell #-} | ||
module None where | ||
|
||
import MyLib | ||
import Language.Haskell.TH | ||
|
||
$(do | ||
runIO $ putStrLn $ "Building: " ++ renamedVers | ||
[d| x = () |] | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.