Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Sonar
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Critical" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9Q3JpdGljYWx9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Cxx Plugin does not run any tests or produce coverage results, thus test and coverage reports must be created before running the analysis</p></td></tr></table><h1>Unit Test</h1><p>The C++ plugin supports importing of unit test data from various formats.</p><h2>Supported Formats</h2><p>The C++ Plugin parses xunit compliant format using the <strong>sonar.cxx.xunit.reportPath</strong>. To use other formats, first they need to be converted using the property <strong>sonar.cxx.xunit.xsltURL</strong></p><p>For convenience the following xsl are provided</p><ul><li><strong>boosttest-1.x-to-junit-1.0.xsl </strong> For transforming Boost-reports</li><li><strong>cpptestunit-1.x-to-junit-1.0.xsl </strong>For<strong> </strong>transforming CppTestUnit-reports</li><li><strong>cppunit-1.x-to-junit-1.0.xsl </strong>For transforming CppUnit-reports</li></ul><h1>Coverage</h1><p>0.2 version supports 3 types of coverage. Unit, Integration and Overall coverage. The following properties should be use to import the coverage reports</p><ul><li>sonar.cxx.coverage.reportPath for unit test coverage</li><li>sonar.cxx.coverage.itReportPath for integration test coverage</li><li>sonar.cxx.coverage.overallReportPath for overall test coverage</li></ul><h2>Supported Formats</h2><p>Cobertura and Bullseye (<a href="http://www.bullseye.com/">http://www.bullseye.com/</a>) XML formats are supported from 0.2 version. Previous versions support only Cobertura, and sonar.cxx.gcovr.reportPath needs to be set.</p><h3>Gcov / gcovr</h3><ul><li>Make sure to compile and link with the --coverage-flag. Disable optimizations and switch on debugging.</li><li>Execute your application / your tests. This will generate .gcda-files.</li><li>Collect the coverage information and generate the report using gcovr:</li></ul><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>gcovr -x -r . > report.xml</pre></td></tr></table><h3>Bullseye</h3><ul><li>Create xml coverage report<span style="color: rgb(34,34,34);"><span style="color: rgb(34,34,34);"> </span></span></li></ul><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>covxml -f UTCoverage.cov -o bullseyecoverage-result-0.xml</pre></td></tr></table><h4><span style="color: rgb(34,34,34);"><span style="color: rgb(34,34,34);">Merging coverage results to obtain global coverage</span></span></h4><ul><li>Merging coverage reports for overall coverage<br /><span style="color: rgb(34,34,34);"><span style="color: rgb(34,34,34);"> </span></span></li></ul><p><span style="color: rgb(34,34,34);"><span style="color: rgb(34,34,34);"> </span></span></p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>covmerge -c ITCoverage.cov UTCoverage.cov -f ALLCOVERAGE.cov</pre></td></tr></table><p> </p><p><em><strong><span style="color: rgb(34,34,34);">Notes about coverage display in sonar:</span></strong></em></p><p><span style="color: rgb(34,34,34);">Sonar <3.2 provides metrics for line coverage and branch coverage. Bullseye users have function and branch/decision coverage instead, the cxx plugin coverts the second directly into branch coverage however line coverage is far more complex and cannot be correlated directly into function coverage.</span></p><p><span style="color: rgb(34,34,34);">Line coverage imported from a bullseye report means than function coverage + line branch coverage ( this second occurs since sonar will not display branch coverage if there isn't a line it associated with it). This means also that overall coverage will be affect in sonar and cannot be compared directly to bullseye results. The following pictures illustrate this for a small example project.</span></p><p><span style="color: rgb(34,34,34);"><img class="confluence-embedded-image" width="900" src="/download/attachments/185073817/CovBrowser.png?version=1&modificationDate=1345454328185" data-image-src="/download/attachments/185073817/CovBrowser.png?version=1&modificationDate=1345454328185" data-linked-resource-id="229704875" data-linked-resource-type="attachment" data-linked-resource-default-alias="CovBrowser.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="185073817" title="Sonar > C++ Plugin (Community) > CovBrowser.png"><br /></span></p><p><span style="color: rgb(34,34,34);"><img class="confluence-embedded-image" width="900" src="/download/attachments/185073817/CovBrowserSummary.png?version=1&modificationDate=1345454345228" data-image-src="/download/attachments/185073817/CovBrowserSummary.png?version=1&modificationDate=1345454345228" data-linked-resource-id="229704876" data-linked-resource-type="attachment" data-linked-resource-default-alias="CovBrowserSummary.png" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="185073817" title="Sonar > C++ Plugin (Community) > CovBrowserSummary.png"><br /></span></p><div><span style="color: rgb(34,34,34);"><br /></span></div>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced