<div dir="ltr"><br><br><div class="gmail_quote">On Thu, Oct 2, 2008 at 3:07 PM, David Roundy <span dir="ltr">&lt;<a href="mailto:droundy@darcs.net">droundy@darcs.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Thu, Oct 02, 2008 at 02:59:01PM -0700, Jason Dagit wrote:<br>
&gt; On Thu, Oct 2, 2008 at 2:49 PM, David Roundy &lt;<a href="mailto:droundy@darcs.net">droundy@darcs.net</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi all,<br>
&gt; &gt;<br>
&gt; &gt; This is a patch that I&#39;m probably going to stop working on myself, but<br>
&gt; &gt; which I&#39;d be delighted if someone else were to make work. &nbsp;It (almost)<br>
&gt; &gt; makes the darcs test suite able to work with hpc, Haskell Program<br>
&gt; &gt; Coverage. &nbsp;This is a really cool but extremely awkard feature of ghc<br>
&gt; &gt; that tracks which expressions and which functions are run, so we could<br>
&gt; &gt; see how thorough our test suite is, and get a good idea as to what<br>
&gt; &gt; functions we might want to add new tests for.<br>
&gt; &gt;<br>
&gt; &gt; The trouble is that it always dumps its output in the working<br>
&gt; &gt; directory in which darcs is called. &nbsp;Since the test suite cleans up<br>
&gt; &gt; after itself, this makes it awkward to get the coverage data out. &nbsp;The<br>
&gt; &gt; approach I tried in this patch is to create a wrapper that calls darcs<br>
&gt; &gt; and then rescues the data.<br>
&gt;<br>
&gt;<br>
&gt; I thought we already accepted patches for this? &nbsp;I recall contacting the<br>
&gt; author of HPC and discussing solutions with him. &nbsp;The fix was to add a<br>
&gt; feature to HPC so that the tix files could be collected somewhere other than<br>
&gt; the working directory. &nbsp;Off the top of my head I thought this was done via<br>
&gt; an env variable.<br>
&gt;<br>
&gt; After that, I seem to recall someone providing patches to make this work. &nbsp;I<br>
&gt; admit, I didn&#39;t yet play with it, but now that I&#39;m running ghc6.8.3 I was<br>
&gt; going to try it out soon. &nbsp;In fact, I was hoping to mention the coverage in<br>
&gt; my thesis as a versus type witnesses sort of thing.<br>
&gt;<br>
&gt; Ah, yes see here:<br>
&gt; <a href="http://lists.osuosl.org/pipermail/darcs-users/2008-May/012255.html" target="_blank">http://lists.osuosl.org/pipermail/darcs-users/2008-May/012255.html</a><br>
&gt;<br>
&gt; It almost works, but doesn&#39;t really, as I can see that the coverage<br>
&gt; &gt; sometimes drops as the test suite is run. &nbsp;Debugging it is really not<br>
&gt; &gt; a good use of my time, and the best and simplest option would probably<br>
&gt; &gt; be to fix ghc to allow you to configure the directory in which the<br>
&gt; &gt; darcs.tix data is dumped (e.g. by an environment variable).<br>
&gt;<br>
&gt;<br>
&gt; And then use ghc <a href="http://6.8.3." target="_blank">6.8.3.</a> &nbsp;In fact, I thought someone even made the results<br>
&gt; web accessible, but the URL is now a 404:<br>
&gt; <a href="http://www.downstairspeople.org/darcs-hpc/hpc_index.html" target="_blank">http://www.downstairspeople.org/darcs-hpc/hpc_index.html</a><br>
&gt;<br>
&gt; My vote is to not add this complexity and instead just use a sufficiently<br>
&gt; recent ghc when these statistics are wanted.<br>
<br>
</div></div>I feel very foolish, you&#39;re right that the docs are right there in<br>
darcs. &nbsp;My problem was that I&#39;m running with ghc 6.8.2, and that hpc<br>
docs haven&#39;t been fixed to reflect that this bugfix went in, see:<br>
<br>
<a href="http://projects.unsafeperformio.com/hpc/" target="_blank">http://projects.unsafeperformio.com/hpc/</a><br>
<br>
and<br>
<br>
<a href="http://www.haskell.org/ghc/docs/latest/html/users_guide/hpc.html" target="_blank">http://www.haskell.org/ghc/docs/latest/html/users_guide/hpc.html</a><br>
<br>
So it&#39;s not just me being stupid, the ghc docs are out of date.</blockquote><div><br>That&#39;s unfortunate about the docs.&nbsp; Here is Andy&#39;s blog about the feature in question:<br><a href="http://blog.unsafeperformio.com/?p=21">http://blog.unsafeperformio.com/?p=21</a><br>
<br>I&#39;m glad we stopped you before you rewrote the whole test suite :)<br><br>Jason<br></div></div><br></div>