Ticket #940 (closed defect: fixed)

Opened 13 months ago

Last modified 13 months ago

cabal build silently ignores test-suites without Build-Depends

Reported by: edsko Owned by: kosmikus
Priority: normal Milestone: cabal-install-0.14.2
Component: cabal-install tool Version: 1.14.0
Severity: normal Keywords: test-suite, solver
Cc: Difficulty: unknown
GHC Version: 7.4.1 Platform: Mac OS

Description

A section such as

Test-Suite foo

Type: exitcode-stdio-1.0 Main-Is: test-foo.hs

without a Build-Depends will not be built by "cabal build", and a subsequent "cabal test" will then complain "cabal: No test suites enabled. Did you remember to configure with '--enable-tests'?"

Change History

Changed 13 months ago by kosmikus

  • keywords test-suite added
  • owner set to ttuegel
  • version changed from 1.10.2.0 to 1.14.0
  • milestone set to Cabal-1.16

Changed 13 months ago by ttuegel

  • keywords test-suite, solver added; test-suite removed

This is caused by the modular solver not passing the '--enable-tests' flag to configure when the build depends are empty. Using '--solver=topdown' works around the problem, so I'm keywording the bug.

Changed 13 months ago by kosmikus

  • owner changed from ttuegel to kosmikus
  • component changed from Cabal library to cabal-install tool
  • milestone changed from Cabal-1.16 to cabal-install-0.14.2

Changed 13 months ago by kosmikus

  • status changed from new to closed
  • resolution set to fixed

Thanks for the analysis, Thomas.

I think I've fixed it:

commit 4c360d4e6e3a558334880dd0498837171229721b
Author: Andres Loeh <andres@well-typed.com>
Date:   Wed Apr 25 12:12:13 2012 +0200

    Handle test and bench stanzas without dependencies properly in modular solver.
    
    During index conversion, the modular solver was discarding test and
    bench stanzas without dependencies. As a result, constraints to enable
    tests and benchmarks were then ignored in the solver.
    
    This should close issue #940.

Also merged into the cabal-1.14 branch, as it's a solver-only bugfix.

Note: See TracTickets for help on using tickets.