The report integration to Jenkins is the ultimate goal, so a partial data lookup is made, and the HTML and XML report Integration Jenkins is configured as follows:
An integrated HTML report
This approach is integrated on the basis that you have generated the HTML report with Gcov+lcov, just put it in Jenkins, in the following steps:
1 Open jenkins-> Enter Project---configuration--Add post-Build action steps->publish HTML reports
2 Generating HTML reports: Configuration--Add build steps->execute Shell
-c-o Coverage.info -B-/data/report/coverage #注意该路径与html报告的读取路径一致
3 Finish running, you can see the THML report point on the left and middle side of the Jenkins page to see the details, as follows
XML report of two integrated Cobertura
Integration into Cobertura is similar to integrating into HTML, and requires configuration of post-build steps and execute shell, as follows
1 Jenkins ' Cobertura plugin
1) Jenkins installation plugin Cobertura: Jenkins page, System Management, management plug-in, you can search for the installation plugin on this page cobertura
2) in the project configuration, add post-build operation steps ->publish Cobertura Coverage Report
3) configuration Cobertura
2 Configuring the Execute shell to get the XML file
1) Add build steps in Jenkins's engineering configuration->execute shell
sudo sh/data/ad_server/--xml-pretty-r. --output/data/adservertest/coverage.xml
2) View results after Jenkins is built
Three questions
1 Jenkins configuration generates an XML report failure with the following error:
using ' /data/cppcoverage/xml/coverage.xml ' ' /data/adservertest '. Did you enter a pattern relative to the correct directory? for Cobertura?
Cause: The Jenkins path is not associated, and I have not yet figured out how to change the resulting XML report to the/data/adservertest of the Jenkins hint, after the path.
2 When viewing the detailed report, it is not possible to view a specific line of code overlay, prompting source code is unavailable, as follows:
Reason: I have not resolved, the following supplement
"C + +" Statistical Code coverage (III)