[Haskell-cafe] The State of Testing?

Ryan Newton rrnewton at gmail.com
Tue Feb 7 23:12:43 CET 2012


By the way, has anyone else had trouble with "cabal test" diverging?

I've been running into this issue with cabal 0.10.2, but ONLY in
conjunction with GHC 6.12.3.  It's hard to make a small reproducer for (and
therefore I haven't filed a bug yet), but you can see the below Jenkins run
stalled for 2.5 days, whereas it should take minutes:

http://tester-lin.soic.indiana.edu:8080/job/monad-par_github_master/JENKINS_GHC=ghc-6.12.3/17/console

Note that it *doesn't* burn CPU -- it deadlocks rather than spins.

I replaced "cabal test" with a direct call to the test executable and I
haven't seen this problem since.

   -Ryan


On Tue, Feb 7, 2012 at 4:23 PM, Austin Seipp <mad.one at gmail.com> wrote:

> If you're writing a library, you need to compile the library with
> `-fhpc`, i.e. put it in the library stanza, not the testsuite stanza,
> and then you can compile the test program using your library - the
> resulting 'tix' file will contain the library coverage reports. You
> can link a HPC-built library into an executable not compiled with HPC
> just fine.
>
> Normally I only compile the library under HPC mode, link it in a test,
> and distribute the results from that. That way your coverage reports
> don't include the test module (which may or may not be relevant.)
>
> I normally add a cabal flag called 'hpc' which optionally enables
> coverage reports for my library, e.g.
>
> flag hpc
>  default: False
>
> library
>  ...
>  ...
>  if flag(hpc)
>    ghc-options: -fhpc
>
> Then when you want coverage reports, just say 'cabal install -fhpc
> --enable-tests' and the resulting properties executable will spit out
> the results when run.
>
> On Tue, Feb 7, 2012 at 3:16 PM, Michael Craig <mkscrg at gmail.com> wrote:
> > Thanks for the advice, all. I've got test-framework, quickcheck, and
> cabal's
> > test-suite all working together nicely.
> >
> > Cabal seems to support using hpc to check test coverage. If I add -fhpc
> to
> > the ghc-options under the test-suite, I get output like "Test coverage
> > report written to dist/hpc/html/tests/hpc_index.html" and "Package
> coverage
> > report written to dist/hpc/html/test-0.0.0/hpc_index.html", but those
> html
> > files are just empty tables. How does this work?
> >
> > Mike Craig
> >
> >
> >
> >
> > On Thu, Feb 2, 2012 at 8:45 PM, Ivan Lazar Miljenovic
> > <ivan.miljenovic at gmail.com> wrote:
> >>
> >> On 03/02/2012 12:22 PM, "Johan Tibell" <johan.tibell at gmail.com> wrote:
> >> >
> >> > On Thu, Feb 2, 2012 at 4:46 PM, Conrad Parker <conrad at metadecks.org>
> >> > wrote:
> >> >>
> >> >> On 3 February 2012 08:30, Johan Tibell <johan.tibell at gmail.com>
> wrote:
> >> >> > On Thu, Feb 2, 2012 at 4:19 PM, Conrad Parker <
> conrad at metadecks.org>
> >> >> > wrote:
> >> >> >>
> >> >> >> I've followed what Johan Tibbell did in the hashable package:
> >> >> >
> >> >> >
> >> >> > If I had known how much confusion my childhood friends would
> unleash
> >> >> > on the
> >> >> > Internet when they, at age 7, gave me a nickname that's spelled
> >> >> > slightly
> >> >> > differently from my last name, I would have asked them to pick
> >> >> > another one.
> >> >> > ;)
> >> >>
> >> >> lol, sorry, I actually double-checked the number of l's before
> writing
> >> >> that but didn't consider the b's. For future reference I've produced
> a
> >> >> handy chart:
> >> >>
> >> >>
> >> >>
> >> >> Letter | Real-name count | Nickname count
> >> >> -------+-----------------+---------------
> >> >> b      | 1               | 2
> >> >> l      | 2               | 0
> >> >> -------+-----------------+---------------
> >> >> SUM    | 3               | 2
> >> >>
> >> >
> >> > Excellent. I will tattoo it on my forehead.
> >>
> >> There is, of course, a simpler (but not necessarily easier :p) solution:
> >> change your name to match your nickname!
> >>
> >> >
> >> >
> >> > _______________________________________________
> >> > Haskell-Cafe mailing list
> >> > Haskell-Cafe at haskell.org
> >> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >> >
> >>
> >>
> >> _______________________________________________
> >> Haskell-Cafe mailing list
> >> Haskell-Cafe at haskell.org
> >> http://www.haskell.org/mailman/listinfo/haskell-cafe
> >>
> >
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
>
>
>
> --
> Regards,
> Austin
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20120207/39806a79/attachment-0001.htm>


More information about the Libraries mailing list