[Haskell-cafe] Re: Problems with Haskell Program Coverage

Don Stewart dons at galois.com
Sun Apr 26 12:35:13 EDT 2009

> Malcolm Wallace <Malcolm.Wallace <at> cs.york.ac.uk> writes:
> > 
> > Dominic Steinitz <dominic.steinitz <at> blueyonder.co.uk> wrote:
> > 
> > > I want to use hpc to check that the ASN.1 library tests cover all the
> > > code.  When I run it with a set of tests that I *know* don't test
> > > certain things, it  reports that they have been covered i.e. there are
> > > not coloured in the markup  that hpc produces. I would have expected a
> > > lot of yellow.
> > 
> > The record of coverage is cumulative across multiple runs.  Is it
> > possible that you did not remove an old .tix file before running the
> > tests?
> Thanks for your reply I was beginning to worry I might be the only person trying
> to use this.

I've used it a *lot*. 

> I've done a bit of investigation and it seems there are at least two problems:
> 1. I have literate haskell files (.lhs).
> 2. Even if I run them through the pre-processor (ghc -E) they still don't work 
> but if I manually remove these lines (which seem to get inserted by the
> pre-processor)
> {-# LINE 1 "ASNTYPE.lhs" #-}
> #line 1 "ASNTYPE.lhs"
> then it does actually work.
> It looks like a bug to me. I guess I should report it on the ghc trac.

Ah, I think this is a known issue with .lhs (or with preprocessors), not
handling source locations properly (?). Contact Andy.

-- Don

More information about the Haskell-Cafe mailing list