New test-suite functionality

Antoine Latter aslatter at gmail.com
Fri Nov 26 21:39:19 EST 2010


On Fri, Nov 26, 2010 at 6:10 PM, Thomas Tuegel <ttuegel at gmail.com> wrote:
> On Thu, Nov 25, 2010 at 11:07 PM, Antoine Latter <aslatter at gmail.com> wrote:
>> Hi Cabal,
>>
>> Is there documentation for the new test-suite functionality? I tried
>> adding the following stanza to my package description:
>>
>> test-suite basic
>>    default-language: Haskell2010
>>    type: exitcode-stdio-1.0
>>    main-is: Basic.hs
>>    hs-source-dirs: tests
>>
>> Running 'cabal test' only yields :
>>
>> Running 0 test suites...
>> 0 of 0 test suites (0 of 0 test cases) passed.
>>
>> Am I doing something wrong? It would be nice if I got an error
>> message. It doesn't seem to matter at all what I fill in to the stanza
>> for the main-is and hs-source-dirs fields.
>>
>> Thanks,
>> Antoine
>
> Are you configuring/building the package with the commands 'cabal
> configure --enable-tests' and 'cabal build' before trying to run
> tests?  I suspect the problem you are encountering is that the default
> option for 'configure' is '--disable-tests'.  I apologize for the
> confusion; this is documented in the Cabal User's Guide, but obviously
> the documentation I wrote needs improvement :)

Yep, that was it. Is there a reason the 'test' command doesn't work by
default? It seems odd that typing 'cabal test' isn't enough of an
indication of what I wanted to do. There are probably backwards
compatibility concerns I don't know about, though.

Thanks for the help and for developing the test-suite infrastructure.

Antoine

>
> This case also indicates to me that we need to add a gentle reminder
> about 'cabal configure --enable-tests' whenever 'cabal test' is
> invoked, but no test suites are found.
>
> --
> Thomas Tuegel
>



More information about the cabal-devel mailing list