Skip to content

HPC trouble in Cabal's own testsuite #1012

int-e opened this Issue Aug 23, 2012 · 2 comments

2 participants

int-e commented Aug 23, 2012

The problem manifests itself with errors like the following when running the testsuite.

> pwd
> touch tests/PackageTests/TestStanza/Setup.hs # to reproduce the issue reliably
> cabal test
ERROR: user error (Command "[...]/tests/PackageTests/TestStanza/Setup clean"
in PackageTests/TestStanza failed.)

The unit-tests testsuite is compiled and run with HPC support enabled. Internally, it compiles various Setup.hs files, also with HPC enabled. Each of these Setup executables has its own Main module. However, when run, they all collect coverage information in the same file -- dist/hpc/tix/unit-tests/unit-tests.tix (This file name is determined by the HPCTIXFILE environment variable, which is set by Cabal's testsuite support). HPC finds the clashing module name and bails out.

(I will submit a fix shortly)

int-e commented Aug 23, 2012

6ed73cd is a minimal fix for this issue.

If we actually want hpc support for these Setup executables, I believe we should ask for proper package support in HPC first: instead of identifying a module simply by its name, include the package name into the key as well. Then we could compile each Setup executable in its own package using -package-name.

int-e commented Aug 24, 2012

@dcoutts Maybe you can comment on this, since we already discussed it on #haskell?

@tibbe tibbe closed this in 6ed73cd Aug 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.