Skip to content

Add expectBroken test for #7423 #8224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/Check/NoWarnFlag/cabal.out
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.
10 changes: 10 additions & 0 deletions cabal-testsuite/PackageTests/Check/NoWarnFlag/cabal.test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Test.Cabal.Prelude

-- Do not output warning when an -O2 is behind a cabal flag.
main = cabalTest . expectBroken 7423 $ do
res <- cabal' "check" []
assertOutputContains "No errors or warnings could be found in the package." res

-- once the test is not broken, replace main with:
-- main = cabalTest $ cabal "check" []

18 changes: 18 additions & 0 deletions cabal-testsuite/PackageTests/Check/NoWarnFlag/pkg.cabal
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: [email protected]
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