diff options
| author | Martin Hořeňovský | 2024-08-14 12:32:44 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2024-08-14 12:33:55 +0200 |
| commit | fa306fc85eca7cc68a5362c503019fa823cbe411 (patch) | |
| tree | 31afcdf2ef001ed50061807762c2a42b1fb2903e /src/catch2 | |
| parent | 35c3403fbbff09062b8b2ab035aaf571b3064fa4 (diff) | |
| download | catch3-fa306fc85eca7cc68a5362c503019fa823cbe411.tar.gz | |
Improve performance of SonarQube reporter handling passing assertions
This mirrors the changes done to the JUnit reporter in commit
fe483c056d9516d3550519c29fbf14a4d84d06d4
Diffstat (limited to 'src/catch2')
| -rw-r--r-- | src/catch2/reporters/catch_reporter_sonarqube.cpp | 4 | ||||
| -rw-r--r-- | src/catch2/reporters/catch_reporter_sonarqube.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/reporters/catch_reporter_sonarqube.cpp b/src/catch2/reporters/catch_reporter_sonarqube.cpp index 9c391b1f..2c3eb1cd 100644 --- a/src/catch2/reporters/catch_reporter_sonarqube.cpp +++ b/src/catch2/reporters/catch_reporter_sonarqube.cpp @@ -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)); diff --git a/src/catch2/reporters/catch_reporter_sonarqube.hpp b/src/catch2/reporters/catch_reporter_sonarqube.hpp index 906578bb..509f411e 100644 --- a/src/catch2/reporters/catch_reporter_sonarqube.hpp +++ b/src/catch2/reporters/catch_reporter_sonarqube.hpp @@ -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; } |