Skip to content

Commit

Permalink
Test and changelog note for check warning on -j.
Browse files Browse the repository at this point in the history
  • Loading branch information
quasicomputational committed May 25, 2018
1 parent 24dee0a commit ab99f01
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ extra-source-files:
tests/ParserTests/regressions/generics-sop.cabal
tests/ParserTests/regressions/generics-sop.expr
tests/ParserTests/regressions/generics-sop.format
tests/ParserTests/regressions/ghc-option-j.cabal
tests/ParserTests/regressions/ghc-option-j.check
tests/ParserTests/regressions/haddock-api-2.18.1-check.cabal
tests/ParserTests/regressions/haddock-api-2.18.1-check.check
tests/ParserTests/regressions/issue-5055.cabal
Expand Down
2 changes: 2 additions & 0 deletions Cabal/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
non-library components (#5309).
* Reduced warnings generated by hsc2hs and c2hs when `cxx-options` field
is present in a component.
* `cabal check` now warns if `-j` is used in `ghc-options` in a Cabal
file. (#5277)

----

Expand Down
1 change: 1 addition & 0 deletions Cabal/tests/CheckTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ checkTests = testGroup "regressions"
, checkTest "bad-glob-syntax.cabal"
, checkTest "cc-options-with-optimization.cabal"
, checkTest "cxx-options-with-optimization.cabal"
, checkTest "ghc-option-j.cabal"
]

checkTest :: FilePath -> TestTree
Expand Down
18 changes: 18 additions & 0 deletions Cabal/tests/ParserTests/regressions/ghc-option-j.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cabal-version: 2.2
name: ghc-option-j
version: 0
license: BSD-2-Clause
synopsis: Test
description: Testy test.
maintainer: none
category: none

library
exposed-modules: Foo
ghc-options: -Wall -j -Wno-all
default-language: Haskell2010

executable foo
main-is: Main.hs
ghc-shared-options: -Wall -j2 -Wno-all
default-language: Haskell2010
2 changes: 2 additions & 0 deletions Cabal/tests/ParserTests/regressions/ghc-option-j.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'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.
'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.

0 comments on commit ab99f01

Please sign in to comment.