Running stack test --coverage generates a nice HTML report showing what lines your test suite covers. How can I achieve the same thing using cabal new-test?
I'm able to pass --enable-coverage to generate a .tix file but I'm not sure what to run on the .tix file to generate the HTML report. I'm pretty sure it involves hpc but I haven't been able to work out the right command.
I have the standard Cabal configuration of my application being a library, with a test-suite for that library.
It appears it's as easy as passing
--enable-coveragetocabal new-test. I had previously been running tests withcabal new-run test:testto workaround some limitations ofnew-test(e.g. lacking streaming and colors), so the fix is to usenew-testinstead ofnew-run.