
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

Adding Thomas who wrote the code.
On Fri, Nov 26, 2010 at 6:07 AM, Antoine Latter
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

On Thu, Nov 25, 2010 at 11:07 PM, Antoine Latter
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 :) 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

On Fri, Nov 26, 2010 at 6:10 PM, Thomas Tuegel
On Thu, Nov 25, 2010 at 11:07 PM, Antoine Latter
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

On Sat, Nov 27, 2010 at 3:39 AM, Antoine Latter
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.
Since the tests are built during the "build" phase rather than during the "test" phase we decided to not build the tests by default to cut down on build times in the default case. Johan

On Sat, 2010-11-27 at 13:18 +0100, Johan Tibell wrote:
On Sat, Nov 27, 2010 at 3:39 AM, Antoine Latter
wrote: 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.
Since the tests are built during the "build" phase rather than during the "test" phase we decided to not build the tests by default to cut down on build times in the default case.
And because building them would pull in extra dependencies (which have to be checked at configure time). So we ought to find a better way of representing the situation with configure --disable-tests, so that cabal test fails with a helpful error message to reconfigure with --enable-tests, and rebuild. Currently we cannot distinguish no testsuites from disabled testsuites. Duncan

On Tue, Nov 30, 2010 at 5:12 PM, Duncan Coutts
So we ought to find a better way of representing the situation with configure --disable-tests, so that cabal test fails with a helpful error message to reconfigure with --enable-tests, and rebuild. Currently we cannot distinguish no testsuites from disabled testsuites.
Changing the 'testSuites' field of the PackageDescription to be a 'Maybe [TestSuites]' instead of just '[TestSuites]' would do. ('Nothing' == disabled tests and 'Just []' == no tests.) A patch like that would touch a lot of places in the test suite code, but not in a meaningful way. Should I write a patch to do it this way? -- Thomas Tuegel

Hi,
Thomas Tuegel
On Thu, Nov 25, 2010 at 11:07 PM, Antoine Latter
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 <snip>
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 :)
May I ask where that documentation can be found? [1] doesn't mention a single word about a test stanza. I've been trying to find some kind of documentation since cabal started to complain, that my definition of the runTests hook is deprecated. [1] http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/ Regards, Jean PS: Please include my email address on reply, since I am not subscribed to this mailing list.

On Sat, Nov 27, 2010 at 8:01 AM, Jean-Marie Gaillourdet
May I ask where that documentation can be found? [1] doesn't mention a single word about a test stanza. I've been trying to find some kind of documentation since cabal started to complain, that my definition of the runTests hook is deprecated.
The online User's Guide has not yet been updated. (Actually, none of the GHC 7 docs appear to be on haskell.org yet.) I thought that the User's Guide shipped with the Cabal library, but I just checked and that is not the case. At the moment, it appears that the only way to get the most recent User's Guide is to check out a development version of Cabal [1]. Duncan, I am CC'ing you to make sure you are aware of the situation. Is there another source for the User's Guide? [1]. http://www.haskell.org/cabal/code.html -- Thomas Tuegel

On Sat, 2010-11-27 at 12:30 -0600, Thomas Tuegel wrote:
On Sat, Nov 27, 2010 at 8:01 AM, Jean-Marie Gaillourdet
wrote: May I ask where that documentation can be found? [1] doesn't mention a single word about a test stanza. I've been trying to find some kind of documentation since cabal started to complain, that my definition of the runTests hook is deprecated.
The online User's Guide has not yet been updated.
Yep, sorry for the delay, it'll appear here when I update the cabal site: http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/ Duncan

On Mon, Nov 29, 2010 at 7:04 AM, Duncan Coutts
On Sat, 2010-11-27 at 12:30 -0600, Thomas Tuegel wrote:
On Sat, Nov 27, 2010 at 8:01 AM, Jean-Marie Gaillourdet
wrote: May I ask where that documentation can be found? [1] doesn't mention a single word about a test stanza. I've been trying to find some kind of documentation since cabal started to complain, that my definition of the runTests hook is deprecated.
The online User's Guide has not yet been updated.
Yep, sorry for the delay, it'll appear here when I update the cabal site:
http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/
I realized through all this that I never added a section to the Users Guide that talked about the two new options to 'setup configure'. The attached small patch corrects my earlier oversight :) -- Thomas Tuegel
participants (5)
-
Antoine Latter
-
Duncan Coutts
-
Jean-Marie Gaillourdet
-
Johan Tibell
-
Thomas Tuegel