"C + +" Statistical Code coverage (III)

Source: Internet
Author: User

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

    1. -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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.