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

#901: Allow package properties to depend on --enable-tests and --enable- benchmarks. ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: minor | Keywords: tests, benchmarks Difficulty: unknown | Ghcversion: Platform: | ----------------------------+----------------------------------------------- In containers, in order for tests to build we need to compile the whole library with -DTESTING. Although it is probably not The Right Design (TM), it is a simple way of exporting internals used by the tests. It would be great if the package properties could depend on whether the tests were enabled or disabled (possibly also on benchmarks), either by creating flags reflecting the {{{--enable-tests}}}, or by special syntax like {{{if enabled(tests)}}}, or anything else. Currently we have flag {{{testing}}}, so whenever we want to build the tests, we pass {{{-ftesting --enable-tests}}} to the cabal configure. But only {{{--enable-tests}}} should suffice, if the tests are meant to run automatically. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/901 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#901: Allow package properties to depend on --enable-tests and --enable- benchmarks. --------------------------------+------------------------------------------- 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 Comment: 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
participants (1)
-
Hackage