polysquare / cmake-unit

A unit testing framework for CMake
MIT License
36 stars 5 forks source link

Set CMAKE_UNIT_COVERAGE_FILE properly before running inner tests #92

Closed smspillaz closed 9 years ago

smspillaz commented 9 years ago

Previously, we were re-using the value for CMAKE_UNIT_COVERAGE_FILE implicitly by including AuxCMakeLists.txt and running the PRECONFIGURE phase. This may have caused the coverage file currently in use for the parent test suite to be overwritten, which was incorrect. This led to incorrect coveraeg results.

We now set CMAKE_UNIT_COVERAGE_FILE to something sensible - either a user specified coverage file if the test needs to collect coverage data on inner tests, or to an empty string.