[Hackage] #901: Allow package properties to depend on --enable-tests and --enable-benchmarks.

Hackage cvs-ghc at haskell.org
Wed Nov 30 18:36:01 CET 2011

#901: Allow package properties to depend on --enable-tests and --enable-
  Reporter:  guest              |        Owner:            
      Type:  enhancement        |       Status:  closed    
  Priority:  normal             |    Milestone:            
 Component:  Cabal library      |      Version:  HEAD      
  Severity:  minor              |   Resolution:  worksforme
  Keywords:  tests, benchmarks  |   Difficulty:  unknown   
Ghcversion:                     |     Platform:            
Changes (by duncan):

  * status:  new => closed
  * resolution:  => worksforme


 I don't see the problem, you just do:

 test-suite blah
   type: exitcode-stdio-1.0
   main-is: tests.hs
   ghc-options: -O2 -DTESTING
   build-depends: base >= 4.2 && < 5, array, deepseq >= 1.2 && < 1.3
   ... etc

 That is, the test suite does not depend on the containers lib, it includes
 the modules directly and so it can specify extra ghc cpp flags.

 Note that you would not want to use `if enabled(tests)` to use `-DTESTING`
 on the main library since that would change the library. Users installing
 the package and for extra paranoia automatically running the testsuite
 would end up with a non-standard, possibly slower package.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/901#comment:1>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list