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.
* Add test for haskell#7423 i.e. Do not warn on -O2 if under off-by-default package configuration flag conditional. * Add a regression for: * Add another -WErrr test This is to make sure we do *not* report it if it is under a user, off-by-default flag. * Add test for non manual user flags. * Add “absolute path in extra-lib-dirs” test * Add if/else test * Add “dircheck on abspath” check * Add Package version internal test * Add PackageVersionsStraddle test
- Loading branch information
Showing
29 changed files
with
239 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlag/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,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlag/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,4 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Do not output warning when an -O2 is behind a cabal flag. | ||
main = cabalTest $ cabal "check" [] |
18 changes: 18 additions & 0 deletions
18
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlag/pkg.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,18 @@ | ||
cabal-version: 2.2 | ||
name: pkg | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
synopsis: synopsys | ||
description: description | ||
license: GPL-3.0-or-later | ||
|
||
flag force-O2 | ||
default: False | ||
manual: True | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
if flag(force-O2) | ||
ghc-options: -O2 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagManual/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,4 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit and not just imposing longer compile times on your users. | ||
|
5 changes: 5 additions & 0 deletions
5
...-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagManual/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,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Output warning when an -O2 inside a cabal flag, but the flag is not | ||
-- marked as `manual: True`. | ||
main = cabalTest $ cabal "check" [] |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagManual/pkg.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: 2.2 | ||
name: pkg | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
synopsis: synopsys | ||
description: description | ||
license: GPL-3.0-or-later | ||
|
||
flag force-O2 | ||
default: False | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
if flag(force-O2) | ||
ghc-options: -O2 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/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,4 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit and not just imposing longer compile times on your users. | ||
|
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/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,4 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Output warning when an -O2 outside a cabal flag, along with one inside. | ||
main = cabalTest $ cabal "check" [] |
19 changes: 19 additions & 0 deletions
19
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/pkg.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: 2.2 | ||
name: pkg | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
synopsis: synopsys | ||
description: description | ||
license: GPL-3.0-or-later | ||
|
||
flag force-O2 | ||
default: False | ||
manual: True | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
ghc-options: -O2 | ||
if flag(force-O2) | ||
ghc-options: -O2 |
2 changes: 2 additions & 0 deletions
2
...l-testsuite/PackageTests/Check/ConfiguredPackage/Paths/AbsolutePathExtraLibDirs/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,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
5 changes: 5 additions & 0 deletions
5
...stsuite/PackageTests/Check/ConfiguredPackage/Paths/AbsolutePathExtraLibDirs/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,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Absolute paths can be used in `extra-lib-dirs`. | ||
main = cabalTest $ | ||
cabal "check" [] |
13 changes: 13 additions & 0 deletions
13
...l-testsuite/PackageTests/Check/ConfiguredPackage/Paths/AbsolutePathExtraLibDirs/pkg.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: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
library | ||
exposed-modules: Module | ||
default-language: Haskell2010 | ||
extra-lib-dirs: /home/ |
Empty file.
8 changes: 8 additions & 0 deletions
8
cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/ElseCheck/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,8 @@ | ||
# cabal check | ||
Warning: The following errors will cause portability problems on other | ||
environments: | ||
Warning: 'ghc-options: -j[N]' can make sense for specific user's setup, but it | ||
is not appropriate for a distributed package. Alternatively, if you want to | ||
use this, make it conditional based on a Cabal configuration flag (with | ||
'manual: True' and 'default: False') and enable that flag during development. | ||
Warning: Hackage would reject this package. |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/ElseCheck/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,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- `check` should not be confused by an user flag. | ||
main = cabalTest $ | ||
fails $ cabal "check" [] |
25 changes: 25 additions & 0 deletions
25
cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/ElseCheck/pkg.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,25 @@ | ||
name: pkg | ||
version: 0.0.0.1 | ||
synopsis: The Servant | ||
description: Various capabilities | ||
category: prelude | ||
maintainer: smokejumperit+rfc@gmail.com | ||
license: MIT | ||
license-file: LICENSE | ||
build-type: Simple | ||
cabal-version: >= 1.10 | ||
|
||
flag production | ||
description: Disables failing. | ||
manual: True | ||
default: False | ||
|
||
library | ||
exposed-modules: | ||
RFC.Servant.API | ||
ghc-options: -j | ||
if flag(production) | ||
ghc-options: -feager-blackholing | ||
else | ||
cpp-options: -DDEVELOPMENT | ||
default-language: Haskell2010 |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/WErrorGuarded/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,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/WErrorGuarded/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,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Do not complain if WError is under a user, off-by-default flag. | ||
main = cabalTest $ | ||
cabal "check" [] |
20 changes: 20 additions & 0 deletions
20
cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/WErrorGuarded/pkg.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 | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
flag dev | ||
description: Turn on development settings. | ||
manual: True | ||
default: False | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
if flag(dev) | ||
ghc-options: -Werror | ||
|
6 changes: 6 additions & 0 deletions
6
cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsInternal/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,6 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: These packages miss upper bounds: | ||
- base | ||
Please add them, using `cabal gen-bounds` for suggestions. For more | ||
information see: https://pvp.haskell.org/ |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsInternal/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,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Unbounded (top) base with internal dependency: warn but do not error. | ||
main = cabalTest $ | ||
cabal "check" [] |
19 changes: 19 additions & 0 deletions
19
cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsInternal/pkg.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 | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
build-depends: base <= 3.10 | ||
|
||
executable test-exe | ||
main-is: Main.hs | ||
default-language: Haskell2010 | ||
build-depends: base, pkg | ||
|
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsStraddle/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,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
6 changes: 6 additions & 0 deletions
6
cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsStraddle/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,6 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Straddle deps declarations (build-depends: base > 5, base < 6) | ||
-- should not error. | ||
main = cabalTest $ | ||
cabal "check" [] |
15 changes: 15 additions & 0 deletions
15
cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsStraddle/pkg.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,15 @@ | ||
cabal-version: 3.0 | ||
name: pkg | ||
synopsis: synopsis | ||
description: description | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
license: GPL-3.0-or-later | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
build-depends: base > 2, | ||
base <= 3.10 | ||
|
Empty file.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Check/PackageFiles/DirExistAbs/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,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/Check/PackageFiles/DirExistAbs/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,5 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Do not warn on non-existant directory if it is absolute. | ||
main = cabalTest $ | ||
cabal "check" [] |
17 changes: 17 additions & 0 deletions
17
cabal-testsuite/PackageTests/Check/PackageFiles/DirExistAbs/pkg.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 @@ | ||
Name: pkg | ||
Version: 0.1.0.0 | ||
Synopsis: Low | ||
description: lallalala | ||
License: LGPL-3 | ||
License-File: LICENSE | ||
Maintainer: Maksymilian.Owsianny+AwesomiumRaw@gmail.com | ||
Bug-Reports: https://github.com/MaxOw/awesomium-raw/issues | ||
Category: Graphics, Web | ||
Build-Type: Simple | ||
Cabal-Version: >=1.8 | ||
|
||
Library | ||
Exposed-Modules: Graphics.UI.Awesomium.Raw | ||
Build-Depends: base >= 3 && < 5 | ||
Extra-Lib-Dirs: /usr/lib/awesomium-1.6.5 | ||
|