Ticket #811 (closed defect: fixed)

Opened 15 months ago

Last modified 5 months ago

test-suite type not detected

Reported by: basvandijk Owned by: ttuegel
Priority: normal Milestone: Cabal-1.10
Component: Cabal library Version: 1.10.1.0
Severity: normal Keywords:
Cc: Difficulty: unknown
GHC Version: Platform:

Description

I just installed the latest cabal:

$ cabal --version
cabal-install version 0.10.2
using version 1.10.1.0 of the Cabal library 

I'm trying to rewrite the custom test-suite of my  threads package to the new Cabal test-suite feature. The original .cabal contains:

...
executable test-threads
  main-is: test.hs
  ...

When I rewrite that to:

...
test-suite test-threads 
  type: exitcode-stdio-1.0

  main-is: test.hs
  ...

And than configure it, I get the following error:

$ cabal configure
cabal: threads.cabal:60: The 'type' field is required for test suites. The available test types are: exitcode-stdio-1.0

I attached the package.

Duncan on #haskell figured out that if a .cabal contains conditionals, like the one I have, the bug appears.

Attachments

threads.cabal Download (2.9 KB) - added by duncan 15 months ago.
threads.2.cabal Download (2.5 KB) - added by ttuegel 15 months ago.
cabal-head-fix-test-suite-conditionals.dpatch Download (37.5 KB) - added by ttuegel 15 months ago.
Fix bug in Cabal HEAD.
cabal-1.10-fix-test-suite-conditionals.dpatch Download (117.2 KB) - added by ttuegel 15 months ago.
Fix bug in Cabal-1.10 branch.

Change History

Changed 15 months ago by duncan

follow-up: ↓ 2   Changed 15 months ago by duncan

  • owner set to ttuegel
  • milestone set to Cabal-1.10

The threads.cabal file in question is attached. If necessary the rest of the repo is at

 http://code.haskell.org/~basvandijk/code/threads

in reply to: ↑ 1   Changed 15 months ago by ttuegel

Replying to duncan:

The threads.cabal file in question is attached. If necessary the rest of the repo is at  http://code.haskell.org/~basvandijk/code/threads

I'm looking into this now. It definitely seems to be a bug. However, none of the conditionals used in this particular .cabal file seem to be necessary. I'm attaching what I believe to be an equivalent .cabal file to show you what I mean.

Changed 15 months ago by ttuegel

Changed 15 months ago by ttuegel

Fix bug in Cabal HEAD.

Changed 15 months ago by ttuegel

Fix bug in Cabal-1.10 branch.

  Changed 15 months ago by ttuegel

I uploaded two patches that fix this problem (one for the Cabal-1.10 branch and one for HEAD). I did upload a prior version of these patches this morning, but I realized they introduced a subtle bug in the way BuildInfo? was being handled. Please disregard the old version of these patches.

  Changed 14 months ago by duncan

Applied the version of the patch sent by email

Fri Apr  1 20:21:13 BST 2011  Thomas Tuegel <ttuegel@gmail.com>
  * Fix for test suite stanzas with conditionals.
  Ticket #811. This fixes a problem where Cabal would fail to detect the "type"
  field of a test suite when the test suite contained a conditional. Conditionals
  can now be used, with the restriction that the "type" field and the appropriate
  "main-is" or "test-module" field must be specified together in any conditional
  branch where they occur.

TODO: merge to 1.10 branch.

  Changed 12 months ago by ttuegel

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

Duncan, I noticed that you did apply the 1.10 branch patch I sent you, so I am closing this bug.

  Changed 5 months ago by elga

Note: See TracTickets for help on using tickets.