File tree Expand file tree Collapse file tree 32 files changed +227
-1
lines changed
cabal-testsuite/PackageTests/MultipleLibraries Expand file tree Collapse file tree 32 files changed +227
-1
lines changed Original file line number Diff line number Diff line change @@ -197,4 +197,4 @@ weeder :
197
197
# tags
198
198
.PHONY : tags
199
199
tags :
200
- hasktags -b Cabal/Distribution Cabal/Cabal-described/src Cabal/Language cabal-install/Distribution
200
+ hasktags -b Cabal/Distribution Cabal/Cabal-described/src Cabal/Language cabal-install/Distribution cabal-testsuite/src
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # cabal v2-run
2
+ Resolving dependencies...
3
+ Build profile: -w ghc-<GHCVER> -O1
4
+ In order, the following will be built:
5
+ - pkg-def-0.1.0.0 (lib:publib) (first run)
6
+ - pkg-abc-0.1.0.0 (exe:program) (first run)
7
+ Warning: pkg-def.cabal:13:27: visibility is experimental feature (issue #5660)
8
+ Configuring library 'publib' for pkg-def-0.1.0.0..
9
+ Preprocessing library 'publib' for pkg-def-0.1.0.0..
10
+ Building library 'publib' for pkg-def-0.1.0.0..
11
+ Warning: pkg-abc.cabal:10:15: colon specifier is experimental feature (issue #5660)
12
+ Configuring executable 'program' for pkg-abc-0.1.0.0..
13
+ Preprocessing executable 'program' for pkg-abc-0.1.0.0..
14
+ Building executable 'program' for pkg-abc-0.1.0.0..
Original file line number Diff line number Diff line change
1
+ packages :
2
+ pkg-abc
3
+ pkg-def
4
+
Original file line number Diff line number Diff line change
1
+ import Test.Cabal.Prelude
2
+ main = cabalTest $ do
3
+ -- https://github.com/haskell/cabal/pull/6047 should make this work for older GHCs too?
4
+ skipIf =<< ghcVersionIs (< mkVersion [8 ,8 ])
5
+
6
+ cabal' " v2-run" [" pkg-abc:program" ] >>= assertOutputContains " pkg-def:publib"
7
+
Original file line number Diff line number Diff line change
1
+ module Main (main ) where
2
+ import PkgDef (defValue )
3
+
4
+ main :: IO ()
5
+ main = print defValue
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : pkg-abc
3
+ version : 0.1.0.0
4
+
5
+ executable program
6
+ default-language : Haskell2010
7
+ main-is : Main.hs
8
+ build-depends :
9
+ , base
10
+ , pkg-def :publib
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : pkg-def
3
+ version : 0.1.0.0
4
+
5
+ library
6
+ default-language : Haskell2010
7
+ hs-source-dirs : src
8
+ build-depends : base
9
+ exposed-modules : PkgDef
10
+
11
+ library publib
12
+ default-language : Haskell2010
13
+ visibility : public
14
+ hs-source-dirs : publib
15
+ build-depends : base
16
+ exposed-modules : PkgDef
17
+
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-def:publib"
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-def:pkg-def"
Original file line number Diff line number Diff line change
1
+ # cabal v2-run
2
+ Resolving dependencies...
3
+ Build profile: -w ghc-<GHCVER> -O1
4
+ In order, the following will be built:
5
+ - pkg-abc-0.1.0.0 (lib:pkg-def) (first run)
6
+ - pkg-abc-0.1.0.0 (exe:program) (first run)
7
+ Warning: pkg-abc.cabal:19:15: colon specifier is experimental feature (issue #5660)
8
+ Configuring library 'pkg-def' for pkg-abc-0.1.0.0..
9
+ Preprocessing library 'pkg-def' for pkg-abc-0.1.0.0..
10
+ Building library 'pkg-def' for pkg-abc-0.1.0.0..
11
+ Warning: pkg-abc.cabal:19:15: colon specifier is experimental feature (issue #5660)
12
+ Configuring executable 'program' for pkg-abc-0.1.0.0..
13
+ Preprocessing executable 'program' for pkg-abc-0.1.0.0..
14
+ Building executable 'program' for pkg-abc-0.1.0.0..
Original file line number Diff line number Diff line change
1
+ packages :
2
+ pkg-abc
3
+ pkg-def
4
+
Original file line number Diff line number Diff line change
1
+ import Test.Cabal.Prelude
2
+
3
+ -- https://github.com/haskell/cabal/issues/6083
4
+ -- see pkg-abc.cabal
5
+ main = cabalTest $ do
6
+ -- https://github.com/haskell/cabal/pull/6047 should make this work for older GHCs too?
7
+ skipIf =<< ghcVersionIs (< mkVersion [8 ,8 ])
8
+
9
+ cabal' " v2-run" [" pkg-abc:program" ] >>= assertOutputContains " pkg-abc:pkg-def"
Original file line number Diff line number Diff line change
1
+ module Main (main ) where
2
+ import PkgDef (defValue )
3
+
4
+ main :: IO ()
5
+ main = print defValue
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : pkg-abc
3
+ version : 0.1.0.0
4
+
5
+ library pkg-def
6
+ default-language : Haskell2010
7
+ hs-source-dirs : pkg-def
8
+ build-depends : base
9
+ exposed-modules : PkgDef
10
+
11
+ executable program
12
+ default-language : Haskell2010
13
+ hs-source-dirs : exe
14
+ main-is : Main.hs
15
+
16
+ -- we want that to resolve to pkg-def main library.
17
+ build-depends :
18
+ , base
19
+ , pkg-def :pkg-def
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-abc:pkg-def"
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : pkg-def
3
+ version : 0.1.0.0
4
+
5
+ library
6
+ default-language : Haskell2010
7
+ hs-source-dirs : src
8
+ build-depends : base
9
+ exposed-modules : PkgDef
10
+
11
+ library publib
12
+ default-language : Haskell2010
13
+ visibility : public
14
+ hs-source-dirs : publib
15
+ build-depends : base
16
+ exposed-modules : PkgDef
17
+
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-def:publib"
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-def:pkg-def"
Original file line number Diff line number Diff line change
1
+ # cabal v2-run
2
+ Resolving dependencies...
3
+ Build profile: -w ghc-<GHCVER> -O1
4
+ In order, the following will be built:
5
+ - pkg-abc-0.1.0.0 (lib:pkg-def) (first run)
6
+ - pkg-abc-0.1.0.0 (exe:program) (first run)
7
+ Warning: pkg-abc.cabal:20:15: colon specifier is experimental feature (issue #5660)
8
+ Configuring library 'pkg-def' for pkg-abc-0.1.0.0..
9
+ Preprocessing library 'pkg-def' for pkg-abc-0.1.0.0..
10
+ Building library 'pkg-def' for pkg-abc-0.1.0.0..
11
+ Warning: pkg-abc.cabal:20:15: colon specifier is experimental feature (issue #5660)
12
+ Configuring executable 'program' for pkg-abc-0.1.0.0..
13
+ Preprocessing executable 'program' for pkg-abc-0.1.0.0..
14
+ Building executable 'program' for pkg-abc-0.1.0.0..
Original file line number Diff line number Diff line change
1
+ packages :
2
+ pkg-abc
3
+ pkg-def
4
+
Original file line number Diff line number Diff line change
1
+ import Test.Cabal.Prelude
2
+
3
+ -- This is like T6083Pre, but also goes via mixins
4
+ --
5
+ main = cabalTest $ do
6
+ -- https://github.com/haskell/cabal/pull/6047 should make this work for older GHCs too?
7
+ skipIf =<< ghcVersionIs (< mkVersion [8 ,8 ])
8
+
9
+ cabal' " v2-run" [" pkg-abc:program" ] >>= assertOutputContains " pkg-abc:pkg-def"
Original file line number Diff line number Diff line change
1
+ module Main (main ) where
2
+ import Mixin (defValue )
3
+
4
+ main :: IO ()
5
+ main = print defValue
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : pkg-abc
3
+ version : 0.1.0.0
4
+
5
+ library pkg-def
6
+ default-language : Haskell2010
7
+ hs-source-dirs : pkg-def
8
+ build-depends : base
9
+ exposed-modules : PkgDef
10
+
11
+ executable program
12
+ default-language : Haskell2010
13
+ hs-source-dirs : exe
14
+ main-is : Main.hs
15
+ mixins : pkg-def (PkgDef as Mixin)
16
+
17
+ -- we want that to resolve to pkg-def main library.
18
+ build-depends :
19
+ , base
20
+ , pkg-def :pkg-def
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-abc:pkg-def"
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : pkg-def
3
+ version : 0.1.0.0
4
+
5
+ library
6
+ default-language : Haskell2010
7
+ hs-source-dirs : src
8
+ build-depends : base
9
+ exposed-modules : PkgDef
10
+
11
+ library publib
12
+ default-language : Haskell2010
13
+ visibility : public
14
+ hs-source-dirs : publib
15
+ build-depends : base
16
+ exposed-modules : PkgDef
17
+
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-def:publib"
Original file line number Diff line number Diff line change
1
+ module PkgDef (defValue ) where
2
+
3
+ defValue :: String
4
+ defValue = " pkg-def:pkg-def"
You can’t perform that action at this time.
0 commit comments