Skip to content

"stack test --coverage" only generates reports for one testsuite #716

@mgsloan

Description

@mgsloan

A known and intentional limitation of stack test --coverage is that it only produces a report for the last test-suite in the cabal file. This is a rather tricky problem involving the behavior of hpc:

The .mix files generated for the exeuctable's modules all go directly in the index directory .stack-work/dist/.../hpc/.hpc, rather than being in a subdir for that particular executable. This means that if there are modules named the same thing in each test-suite (e.g. Main), then Main.mix will get overwritten.

I think this can be resolved by specifying a different -hpcdir when building the actual tests, and then cleverly moving the files around when it's time to generate the reports. A previous attempt at this proved to be troublesome, though.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions