Combining test coverage with hpc

I find hpc really confusing, even after reading a few explanations and playing around a bit.

I have a library HMLand two test suites fileio-testand types-test, using HTF(I plan to upgrade to tasty). I would like to run two tests, and then see the combined coverage of the two over the library.

At the moment I am creating a library using

cabal configure --enable-coverage
cabal build

And run the tests using

cabal configure --enable-coverage --enable-tests
cabal build
cabal test

hpc report --hpc-dir dist/hpc/vanilla/mix/fileio-test dist/hpc/vanilla/tix/fileio-test/fileio-test.tix

This shows me some coverage, but not the right one. I think it shows coverage, but only from one of the tests, and also includes coverage of the tests themselves.

I tried to use

--hpc-dir dist/hpc/vanilla/mix/HML-0.1.0.0

But then hpc complains that it cannot find the module files it needs. I also tried combining the coverage of two tests with no luck.

?

+4

Source: https://habr.com/ru/post/1689431/


All Articles