By the way, has anyone else had trouble with "cabal test" diverging?<br><br>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:<br>
<br><a href="http://tester-lin.soic.indiana.edu:8080/job/monad-par_github_master/JENKINS_GHC=ghc-6.12.3/17/console">http://tester-lin.soic.indiana.edu:8080/job/monad-par_github_master/JENKINS_GHC=ghc-6.12.3/17/console</a><br>
<br>Note that it *doesn't* burn CPU -- it deadlocks rather than spins.<br><br>I replaced "cabal test" with a direct call to the test executable and I haven't seen this problem since.<br><br> -Ryan<br>
<br>
<br><div class="gmail_quote">On Tue, Feb 7, 2012 at 4:23 PM, Austin Seipp <span dir="ltr"><<a href="mailto:mad.one@gmail.com">mad.one@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you're writing a library, you need to compile the library with<br>
`-fhpc`, i.e. put it in the library stanza, not the testsuite stanza,<br>
and then you can compile the test program using your library - the<br>
resulting 'tix' file will contain the library coverage reports. You<br>
can link a HPC-built library into an executable not compiled with HPC<br>
just fine.<br>
<br>
Normally I only compile the library under HPC mode, link it in a test,<br>
and distribute the results from that. That way your coverage reports<br>
don't include the test module (which may or may not be relevant.)<br>
<br>
I normally add a cabal flag called 'hpc' which optionally enables<br>
coverage reports for my library, e.g.<br>
<br>
flag hpc<br>
default: False<br>
<br>
library<br>
...<br>
...<br>
if flag(hpc)<br>
ghc-options: -fhpc<br>
<br>
Then when you want coverage reports, just say 'cabal install -fhpc<br>
--enable-tests' and the resulting properties executable will spit out<br>
the results when run.<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Feb 7, 2012 at 3:16 PM, Michael Craig <<a href="mailto:mkscrg@gmail.com">mkscrg@gmail.com</a>> wrote:<br>
> Thanks for the advice, all. I've got test-framework, quickcheck, and cabal's<br>
> test-suite all working together nicely.<br>
><br>
> Cabal seems to support using hpc to check test coverage. If I add -fhpc to<br>
> the ghc-options under the test-suite, I get output like "Test coverage<br>
> report written to dist/hpc/html/tests/hpc_index.html" and "Package coverage<br>
> report written to dist/hpc/html/test-0.0.0/hpc_index.html", but those html<br>
> files are just empty tables. How does this work?<br>
><br>
> Mike Craig<br>
><br>
><br>
><br>
><br>
> On Thu, Feb 2, 2012 at 8:45 PM, Ivan Lazar Miljenovic<br>
> <<a href="mailto:ivan.miljenovic@gmail.com">ivan.miljenovic@gmail.com</a>> wrote:<br>
>><br>
>> On 03/02/2012 12:22 PM, "Johan Tibell" <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>> wrote:<br>
>> ><br>
>> > On Thu, Feb 2, 2012 at 4:46 PM, Conrad Parker <<a href="mailto:conrad@metadecks.org">conrad@metadecks.org</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On 3 February 2012 08:30, Johan Tibell <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>> wrote:<br>
>> >> > On Thu, Feb 2, 2012 at 4:19 PM, Conrad Parker <<a href="mailto:conrad@metadecks.org">conrad@metadecks.org</a>><br>
>> >> > wrote:<br>
>> >> >><br>
>> >> >> I've followed what Johan Tibbell did in the hashable package:<br>
>> >> ><br>
>> >> ><br>
>> >> > If I had known how much confusion my childhood friends would unleash<br>
>> >> > on the<br>
>> >> > Internet when they, at age 7, gave me a nickname that's spelled<br>
>> >> > slightly<br>
>> >> > differently from my last name, I would have asked them to pick<br>
>> >> > another one.<br>
>> >> > ;)<br>
>> >><br>
>> >> lol, sorry, I actually double-checked the number of l's before writing<br>
>> >> that but didn't consider the b's. For future reference I've produced a<br>
>> >> handy chart:<br>
>> >><br>
>> >><br>
>> >><br>
>> >> Letter | Real-name count | Nickname count<br>
>> >> -------+-----------------+---------------<br>
>> >> b | 1 | 2<br>
>> >> l | 2 | 0<br>
>> >> -------+-----------------+---------------<br>
>> >> SUM | 3 | 2<br>
>> >><br>
>> ><br>
>> > Excellent. I will tattoo it on my forehead.<br>
>><br>
>> There is, of course, a simpler (but not necessarily easier :p) solution:<br>
>> change your name to match your nickname!<br>
>><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > Haskell-Cafe mailing list<br>
>> > <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
>> > <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
>> ><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Haskell-Cafe mailing list<br>
>> <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
>> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Regards,<br>
Austin<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>