Boost C++ Unit Testing Code Coverage TeamCity
boost, c++, code-coverage, teamcity
Solution
Google suggests that Boost does not provide code coverage. Instead, folks typically generate coverage stats with lcov (see also). An important feature of lcov is that you can generate an HTML-formatted report of its code coverage statistics.
Happily for us, TeamCity is configured by default to create a 'Reports' tab with a 'Code Coverage' section in your build history. (You can verify this by browsing to `Administration` -> `Report Tabs`.) To take advantage of this, you must provide TeamCity with a build artifact containing the coverage HTML.
- In TeamCity, browse to the configuration/template in which you're doing the testing
- Browse to the 'General Settings' section of the build configuration
In the Artifacts text box, enter the following:
`$PATH_TO_LCOV_OUTPUT_DIR=>coverage.zip`
TeamCity will look for an `index.html` file in the `coverage.zip` artifact and display that as the report.
Problem
Please excuse what may appear to be a novice question. I have searched on the net for awhile without results. Is it possible to get code coverage on TeamCity using the Boost C++ Unit testing framework and how would one be able to factor this in Teamcity.