mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
Avoid copying strings in sonarqube when sorting tests by file
This commit is contained in:
parent
65ffee5189
commit
60264b8807
@ -40,7 +40,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SonarQubeReporter::writeRun( TestRunNode const& runNode ) {
|
void SonarQubeReporter::writeRun( TestRunNode const& runNode ) {
|
||||||
std::map<std::string, std::vector<TestCaseNode const*>> testsPerFile;
|
std::map<StringRef, std::vector<TestCaseNode const*>> testsPerFile;
|
||||||
|
|
||||||
for ( auto const& child : runNode.children ) {
|
for ( auto const& child : runNode.children ) {
|
||||||
testsPerFile[child->value.testInfo->lineInfo.file].push_back(
|
testsPerFile[child->value.testInfo->lineInfo.file].push_back(
|
||||||
@ -52,7 +52,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonarQubeReporter::writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes) {
|
void SonarQubeReporter::writeTestFile(StringRef filename, std::vector<TestCaseNode const*> const& testCaseNodes) {
|
||||||
XmlWriter::ScopedElement e = xml.scopedElement("file");
|
XmlWriter::ScopedElement e = xml.scopedElement("file");
|
||||||
xml.writeAttribute("path"_sr, filename);
|
xml.writeAttribute("path"_sr, filename);
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace Catch {
|
|||||||
|
|
||||||
void writeRun( TestRunNode const& groupNode );
|
void writeRun( TestRunNode const& groupNode );
|
||||||
|
|
||||||
void writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes);
|
void writeTestFile(StringRef filename, std::vector<TestCaseNode const*> const& testCaseNodes);
|
||||||
|
|
||||||
void writeTestCase(TestCaseNode const& testCaseNode);
|
void writeTestCase(TestCaseNode const& testCaseNode);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user