Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost C++ Unit Testing Code Coverage TeamCity

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.

like image 841
user983965 Avatar asked Dec 13 '12 12:12

user983965


1 Answers

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.

  1. In TeamCity, browse to the configuration/template in which you're doing the testing
  2. Browse to the 'General Settings' section of the build configuration
  3. 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.

like image 84
John Hoerr Avatar answered Sep 28 '22 06:09

John Hoerr