-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore block
element for BullsEye coverage reports (since BullsEye covxml 8.20.0 version)
#1977
Comments
Hi @slebedev, Thanks a lot for your feedback. Two questions:
Regards, |
Hi @guwirth, Thanks for the fast feedback!
Let's imagine that we have the following simple code: #include <common/token.h>
namespace Core
{
/// @brief interface for handling tokens
class TokenHandler
{
public:
/// @brief virtual destructor
virtual ~TokenHandler() {}
/// @brief called when handler is about to handle token
virtual void OnHandle() = 0;
/**
@brief called when a token is handled
@param token token handled
*/
virtual void OnTokenHandled(const Common::Token& token) = 0;
/// @brief called when parsing finished
virtual void OnFinish() = 0;
};
} that produces the following coverage.xml after testing: <?xml version="1.0" encoding="UTF-8"?>
<!-- BullseyeCoverage XML 8.20.2 Windows x64 -->
<BullseyeCoverage name="coverage.cov" dir="g:/results" buildId="745ae38_2020-11-09_19:52:34" version="6" xmlns="https://www.bullseye.com/covxml"
fn_cov="1" fn_total="1" cd_cov="0" cd_total="0" d_cov="0" d_total="0">
<folder name="g:" fn_cov="1" fn_total="1" cd_cov="0" cd_total="0" d_cov="0" d_total="0">
<folder name="src" fn_cov="1" fn_total="1" cd_cov="0" cd_total="0" d_cov="0" d_total="0">
<src name="token_handler.h" mtime="1604936026" fn_cov="1" fn_total="1" cd_cov="0" cd_total="0" d_cov="0" d_total="0">
<fn name="Core::TokenHandler::~TokenHandler()" fn_cov="1" fn_total="1" cd_cov="0" cd_total="0" d_cov="0" d_total="0">
<probe line="11" column="7" kind="function" event="full"/>
<block line="11" entered="1"/>
</fn>
</src>
</folder>
</folder>
</BullseyeCoverage> Coverage Sensor fails the scan for now, so my point is to not fail the whole scan if |
block
element for BullsEye coverage reports (since BullsEye covxml 8.20.0 version)block
element for BullsEye coverage reports (since BullsEye covxml 8.20.0 version)
Hi @slebedev, thanks for sharing this. Looking to our code
You see that the line below will mark line 11 as covered. <probe line="11" column="7" kind="function" event="full"/> Think the line below is doing the same <block line="11" entered="1"/> What I still don't understand: What is the advantage of this additional block tag? Docu is saying: The block element is provided to assist with importation to a product that accepts statement coverage or basic block coverage, but not the condition/decision coverage provided by the probe element. You can ignore this element unless you have such a restriction. This coverage information is not statement coverage and is not appropriate for projects with an official mandate for statement coverage. So I would agree to add support to the XML parser and ignore the content. Regards, |
- https://www.bullseye.com/help/ref-covxml.html - File Version: 6, Software Version: 8.20.0, Date: Oct 2020, Change: Add block element - XML parser supports block tag - ignore data of block tag - close SonarOpenCommunity#1977
Description
Coverage sensor stops working with latest BullsEye reports. After quick investigation I've found the issue in new "block" element BullsEye generates in xml report (see current covxml doc):
Steps to reproduce the problem
Please provide the steps required to reproduce the problem
Collect BullsEye xml coverage (8.20.2)
Start scanner for code with provided coverage report
P.S. Unfortunately I can't provide an example right now.
Expected behavior
Coverage Sensor works fine and parses coverage report
Actual behavior
Scanner can't parse coverage report with
block
elementsKnown workarounds
Removing all lines with new
block
elements before scanner run, i.e. like this:sed -i '/<block line=/d' .coverage/coverage.xml
LOG file
Related information
The text was updated successfully, but these errors were encountered: