-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add failing test case for
cabal build --enable-build-info
- Loading branch information
Showing
5 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/ShowBuildInfo/WithProject/Lib.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 Lib (someFunc) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |
13 changes: 13 additions & 0 deletions
13
cabal-testsuite/PackageTests/ShowBuildInfo/WithProject/WithProject.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,13 @@ | ||
cabal-version: 3.0 | ||
name: WithProject | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
|
||
common warnings | ||
ghc-options: -Wall | ||
|
||
library | ||
import: warnings | ||
exposed-modules: Lib | ||
build-depends: base | ||
default-language: Haskell2010 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/ShowBuildInfo/WithProject/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: ./ | ||
|
||
package WithProject | ||
ghc-options: -haddock |
8 changes: 8 additions & 0 deletions
8
cabal-testsuite/PackageTests/ShowBuildInfo/WithProject/with-project.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,8 @@ | ||
# cabal build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- WithProject-0.1.0.0 (lib) (first run) | ||
Configuring library for WithProject-0.1.0.0... | ||
Preprocessing library for WithProject-0.1.0.0... | ||
Building library for WithProject-0.1.0.0... |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/ShowBuildInfo/WithProject/with-project.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,17 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
import Test.Cabal.Prelude | ||
import Test.Cabal.DecodeShowBuildInfo | ||
|
||
main = cabalTest $ do | ||
runShowBuildInfo ["lib:WithProject"] | ||
withPlan $ do | ||
recordBuildInfo "WithProject" mainLib | ||
assertComponent "WithProject" mainLib defCompAssertion | ||
{ compilerArgsPred = ("-Wall" `elem`) -- added by 'WithProject.cabal' | ||
} | ||
|
||
-- See #9927 | ||
fails $ assertComponent "WithProject" mainLib defCompAssertion | ||
{ compilerArgsPred = ("-haddock" `elem`) -- added by 'cabal.project' | ||
} | ||
|