Consider the following use case:
I have a QuickCheck test suite consisting of two test cases prop_testCase1
and prop_testCase2
. Using hpc I can observe the code coverage of my test suite.
However, I'd like to get separate results for the coverage of prop_testCase1
and prop_testCase2
(to then further process the results).
One way out could be to run the executable several times explicitly specifying the test case as a command line argument and to process the generated tix file after each run.
Yet, I would prefer to hide away this logic in a library. Also in reality I would like to run significantly more than just two test cases. Thus explicitly re-executing the binary for each test case seems rather inconvenient. At the same time I'd imagine that hpc keeps the coverage data in some kind of intermediate data structure during the program execution.
Question: Is there a way to recognize that the program has been compiled with hpc symbols and to somehow access the data hpc generates at runtime?