-
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.
- Loading branch information
Showing
5 changed files
with
53 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 @@ | ||
LICENSE |
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 @@ | ||
module MyLibrary () where |
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 @@ | ||
import Distribution.Simple | ||
main = 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,25 @@ | ||
name: CheckSetup | ||
version: 0.1 | ||
license: BSD3 | ||
license-file: LICENSE | ||
author: Alexander Vershilov | ||
maintainer: Alexander Vershilov | ||
synopsis: Check setup | ||
category: PackageTests | ||
build-type: Custom | ||
cabal-version: 2.0 | ||
|
||
description: | ||
Check that Cabal recognizes problems with setup module. | ||
|
||
custom-setup | ||
setup-depends: | ||
base, | ||
Cabal, | ||
bytestring | ||
|
||
Library | ||
default-language: Haskell2010 | ||
build-depends: base <5.0 | ||
exposed-modules: | ||
MyLibrary |
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,24 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Test that setup shows all the 'autogen-modules' warnings. | ||
main = setupAndCabalTest $ do | ||
|
||
checkResult <- fails $ cabal_raw' ["check"] | ||
|
||
-- Package check messages. | ||
let libWarning= | ||
"The dependency 'build-depends: 'bytestring' does not " | ||
++ "specify an upper bound on the version number." | ||
libError1 = | ||
"The dependency 'setup-depends: 'Cabal' does not specify " | ||
++ "an upper bound on the version number" | ||
libError2 = | ||
"The dependency 'setup-depends: 'base' does not specify " | ||
++ "an upper bound on the version number" | ||
|
||
-- Asserts for the desired check messages after configure. | ||
assertOutputContains libWarning checkResult | ||
assertOutputContains libError1 checkResult | ||
assertOutputContains libError2 checkResult | ||
|
||
return () |