mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 13:25:41 +02:00
Improve performance of SonarQube reporter handling passing assertions
This mirrors the changes done to the JUnit reporter in commit
fe483c056d
This commit is contained in:
@@ -73,9 +73,9 @@ namespace Catch {
|
||||
if (!rootName.empty())
|
||||
name = rootName + '/' + name;
|
||||
|
||||
if ( sectionNode.hasAnyAssertions()
|
||||
if ( sectionNode.stats.assertions.total() > 0
|
||||
|| !sectionNode.stdOut.empty()
|
||||
|| !sectionNode.stdErr.empty() ) {
|
||||
|| !sectionNode.stdErr.empty() ) {
|
||||
XmlWriter::ScopedElement e = xml.scopedElement("testCase");
|
||||
xml.writeAttribute("name"_sr, name);
|
||||
xml.writeAttribute("duration"_sr, static_cast<long>(sectionNode.stats.durationInSeconds * 1000));
|
||||
|
@@ -21,7 +21,7 @@ namespace Catch {
|
||||
: CumulativeReporterBase(CATCH_MOVE(config))
|
||||
, xml(m_stream) {
|
||||
m_preferences.shouldRedirectStdOut = true;
|
||||
m_preferences.shouldReportAllAssertions = true;
|
||||
m_preferences.shouldReportAllAssertions = false;
|
||||
m_shouldStoreSuccesfulAssertions = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user