By the way, has anyone else had trouble with &quot;cabal test&quot; diverging?<br><br>I&#39;ve been running into this issue with cabal 0.10.2, but ONLY in conjunction with GHC 6.12.3.  It&#39;s hard to make a small reproducer for (and therefore I haven&#39;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&#39;t* burn CPU -- it deadlocks rather than spins.<br><br>I replaced &quot;cabal test&quot; with a direct call to the test executable and I haven&#39;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">&lt;<a href="mailto:mad.one@gmail.com">mad.one@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

If you&#39;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 &#39;tix&#39; 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&#39;t include the test module (which may or may not be relevant.)<br>
<br>
I normally add a cabal flag called &#39;hpc&#39; 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 &#39;cabal install -fhpc<br>
--enable-tests&#39; 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 &lt;<a href="mailto:mkscrg@gmail.com">mkscrg@gmail.com</a>&gt; wrote:<br>
&gt; Thanks for the advice, all. I&#39;ve got test-framework, quickcheck, and cabal&#39;s<br>
&gt; test-suite all working together nicely.<br>
&gt;<br>
&gt; Cabal seems to support using hpc to check test coverage. If I add -fhpc to<br>
&gt; the ghc-options under the test-suite, I get output like &quot;Test coverage<br>
&gt; report written to dist/hpc/html/tests/hpc_index.html&quot; and &quot;Package coverage<br>
&gt; report written to dist/hpc/html/test-0.0.0/hpc_index.html&quot;, but those html<br>
&gt; files are just empty tables. How does this work?<br>
&gt;<br>
&gt; Mike Craig<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Feb 2, 2012 at 8:45 PM, Ivan Lazar Miljenovic<br>
&gt; &lt;<a href="mailto:ivan.miljenovic@gmail.com">ivan.miljenovic@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 03/02/2012 12:22 PM, &quot;Johan Tibell&quot; &lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Thu, Feb 2, 2012 at 4:46 PM, Conrad Parker &lt;<a href="mailto:conrad@metadecks.org">conrad@metadecks.org</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On 3 February 2012 08:30, Johan Tibell &lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; On Thu, Feb 2, 2012 at 4:19 PM, Conrad Parker &lt;<a href="mailto:conrad@metadecks.org">conrad@metadecks.org</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I&#39;ve followed what Johan Tibbell did in the hashable package:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; If I had known how much confusion my childhood friends would unleash<br>
&gt;&gt; &gt;&gt; &gt; on the<br>
&gt;&gt; &gt;&gt; &gt; Internet when they, at age 7, gave me a nickname that&#39;s spelled<br>
&gt;&gt; &gt;&gt; &gt; slightly<br>
&gt;&gt; &gt;&gt; &gt; differently from my last name, I would have asked them to pick<br>
&gt;&gt; &gt;&gt; &gt; another one.<br>
&gt;&gt; &gt;&gt; &gt; ;)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; lol, sorry, I actually double-checked the number of l&#39;s before writing<br>
&gt;&gt; &gt;&gt; that but didn&#39;t consider the b&#39;s. For future reference I&#39;ve produced a<br>
&gt;&gt; &gt;&gt; handy chart:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Letter | Real-name count | Nickname count<br>
&gt;&gt; &gt;&gt; -------+-----------------+---------------<br>
&gt;&gt; &gt;&gt; b      | 1               | 2<br>
&gt;&gt; &gt;&gt; l      | 2               | 0<br>
&gt;&gt; &gt;&gt; -------+-----------------+---------------<br>
&gt;&gt; &gt;&gt; SUM    | 3               | 2<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Excellent. I will tattoo it on my forehead.<br>
&gt;&gt;<br>
&gt;&gt; There is, of course, a simpler (but not necessarily easier :p) solution:<br>
&gt;&gt; change your name to match your nickname!<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Haskell-Cafe mailing list<br>
&gt;&gt; &gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt;&gt; &gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Haskell-Cafe mailing list<br>
&gt;&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<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>