forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve haskell#6409: Add public multilib test(s)
Also add a test for current behaviour of haskell#6083 And variant with mixin, for haskell#6281 The tests are disable for GHC older than 8.8 Should they work?
- Loading branch information
Showing
32 changed files
with
227 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
cabal-testsuite/PackageTests/MultipleLibraries/Successful/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 v2-run | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- pkg-def-0.1.0.0 (lib:publib) (first run) | ||
- pkg-abc-0.1.0.0 (exe:program) (first run) | ||
Warning: pkg-def.cabal:13:27: visibility is experimental feature (issue #5660) | ||
Configuring library 'publib' for pkg-def-0.1.0.0.. | ||
Preprocessing library 'publib' for pkg-def-0.1.0.0.. | ||
Building library 'publib' for pkg-def-0.1.0.0.. | ||
Warning: pkg-abc.cabal:10:15: colon specifier is experimental feature (issue #5660) | ||
Configuring executable 'program' for pkg-abc-0.1.0.0.. | ||
Preprocessing executable 'program' for pkg-abc-0.1.0.0.. | ||
Building executable 'program' for pkg-abc-0.1.0.0.. |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/Successful/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,4 @@ | ||
packages: | ||
pkg-abc | ||
pkg-def | ||
|
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/MultipleLibraries/Successful/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 | ||
main = cabalTest $ do | ||
-- https://github.com/haskell/cabal/pull/6047 should make this work for older GHCs too? | ||
skipIf =<< ghcVersionIs (< mkVersion [8,8]) | ||
|
||
cabal' "v2-run" ["pkg-abc:program"] >>= assertOutputContains "pkg-def:publib" | ||
|
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/MultipleLibraries/Successful/pkg-abc/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 (main) where | ||
import PkgDef (defValue) | ||
|
||
main :: IO () | ||
main = print defValue |
10 changes: 10 additions & 0 deletions
10
cabal-testsuite/PackageTests/MultipleLibraries/Successful/pkg-abc/pkg-abc.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,10 @@ | ||
cabal-version: 3.0 | ||
name: pkg-abc | ||
version: 0.1.0.0 | ||
|
||
executable program | ||
default-language: Haskell2010 | ||
main-is: Main.hs | ||
build-depends: | ||
, base | ||
, pkg-def:publib |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/MultipleLibraries/Successful/pkg-def/pkg-def.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: 3.0 | ||
name: pkg-def | ||
version: 0.1.0.0 | ||
|
||
library | ||
default-language: Haskell2010 | ||
hs-source-dirs: src | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
||
library publib | ||
default-language: Haskell2010 | ||
visibility: public | ||
hs-source-dirs: publib | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/Successful/pkg-def/publib/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-def:publib" |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/Successful/pkg-def/src/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-def:pkg-def" |
14 changes: 14 additions & 0 deletions
14
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/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 v2-run | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- pkg-abc-0.1.0.0 (lib:pkg-def) (first run) | ||
- pkg-abc-0.1.0.0 (exe:program) (first run) | ||
Warning: pkg-abc.cabal:19:15: colon specifier is experimental feature (issue #5660) | ||
Configuring library 'pkg-def' for pkg-abc-0.1.0.0.. | ||
Preprocessing library 'pkg-def' for pkg-abc-0.1.0.0.. | ||
Building library 'pkg-def' for pkg-abc-0.1.0.0.. | ||
Warning: pkg-abc.cabal:19:15: colon specifier is experimental feature (issue #5660) | ||
Configuring executable 'program' for pkg-abc-0.1.0.0.. | ||
Preprocessing executable 'program' for pkg-abc-0.1.0.0.. | ||
Building executable 'program' for pkg-abc-0.1.0.0.. |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/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,4 @@ | ||
packages: | ||
pkg-abc | ||
pkg-def | ||
|
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/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,9 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- https://github.com/haskell/cabal/issues/6083 | ||
-- see pkg-abc.cabal | ||
main = cabalTest $ do | ||
-- https://github.com/haskell/cabal/pull/6047 should make this work for older GHCs too? | ||
skipIf =<< ghcVersionIs (< mkVersion [8,8]) | ||
|
||
cabal' "v2-run" ["pkg-abc:program"] >>= assertOutputContains "pkg-abc:pkg-def" |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/pkg-abc/exe/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 (main) where | ||
import PkgDef (defValue) | ||
|
||
main :: IO () | ||
main = print defValue |
19 changes: 19 additions & 0 deletions
19
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/pkg-abc/pkg-abc.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,19 @@ | ||
cabal-version: 3.0 | ||
name: pkg-abc | ||
version: 0.1.0.0 | ||
|
||
library pkg-def | ||
default-language: Haskell2010 | ||
hs-source-dirs: pkg-def | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
||
executable program | ||
default-language: Haskell2010 | ||
hs-source-dirs: exe | ||
main-is: Main.hs | ||
|
||
-- we want that to resolve to pkg-def main library. | ||
build-depends: | ||
, base | ||
, pkg-def:pkg-def |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/pkg-abc/pkg-def/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-abc:pkg-def" |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/pkg-def/pkg-def.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: 3.0 | ||
name: pkg-def | ||
version: 0.1.0.0 | ||
|
||
library | ||
default-language: Haskell2010 | ||
hs-source-dirs: src | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
||
library publib | ||
default-language: Haskell2010 | ||
visibility: public | ||
hs-source-dirs: publib | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/pkg-def/publib/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-def:publib" |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083Pre/pkg-def/src/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-def:pkg-def" |
14 changes: 14 additions & 0 deletions
14
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/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 v2-run | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- pkg-abc-0.1.0.0 (lib:pkg-def) (first run) | ||
- pkg-abc-0.1.0.0 (exe:program) (first run) | ||
Warning: pkg-abc.cabal:20:15: colon specifier is experimental feature (issue #5660) | ||
Configuring library 'pkg-def' for pkg-abc-0.1.0.0.. | ||
Preprocessing library 'pkg-def' for pkg-abc-0.1.0.0.. | ||
Building library 'pkg-def' for pkg-abc-0.1.0.0.. | ||
Warning: pkg-abc.cabal:20:15: colon specifier is experimental feature (issue #5660) | ||
Configuring executable 'program' for pkg-abc-0.1.0.0.. | ||
Preprocessing executable 'program' for pkg-abc-0.1.0.0.. | ||
Building executable 'program' for pkg-abc-0.1.0.0.. |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/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,4 @@ | ||
packages: | ||
pkg-abc | ||
pkg-def | ||
|
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/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,9 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- This is like T6083Pre, but also goes via mixins | ||
-- | ||
main = cabalTest $ do | ||
-- https://github.com/haskell/cabal/pull/6047 should make this work for older GHCs too? | ||
skipIf =<< ghcVersionIs (< mkVersion [8,8]) | ||
|
||
cabal' "v2-run" ["pkg-abc:program"] >>= assertOutputContains "pkg-abc:pkg-def" |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/pkg-abc/exe/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 (main) where | ||
import Mixin (defValue) | ||
|
||
main :: IO () | ||
main = print defValue |
20 changes: 20 additions & 0 deletions
20
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/pkg-abc/pkg-abc.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,20 @@ | ||
cabal-version: 3.0 | ||
name: pkg-abc | ||
version: 0.1.0.0 | ||
|
||
library pkg-def | ||
default-language: Haskell2010 | ||
hs-source-dirs: pkg-def | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
||
executable program | ||
default-language: Haskell2010 | ||
hs-source-dirs: exe | ||
main-is: Main.hs | ||
mixins: pkg-def (PkgDef as Mixin) | ||
|
||
-- we want that to resolve to pkg-def main library. | ||
build-depends: | ||
, base | ||
, pkg-def:pkg-def |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/pkg-abc/pkg-def/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-abc:pkg-def" |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/pkg-def/pkg-def.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: 3.0 | ||
name: pkg-def | ||
version: 0.1.0.0 | ||
|
||
library | ||
default-language: Haskell2010 | ||
hs-source-dirs: src | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
||
library publib | ||
default-language: Haskell2010 | ||
visibility: public | ||
hs-source-dirs: publib | ||
build-depends: base | ||
exposed-modules: PkgDef | ||
|
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/pkg-def/publib/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-def:publib" |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/MultipleLibraries/T6083PreMixin/pkg-def/src/PkgDef.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 PkgDef (defValue) where | ||
|
||
defValue :: String | ||
defValue = "pkg-def:pkg-def" |