Remove <set> include from the common test path

This commit is contained in:
Martin Hořeňovský
2017-07-27 22:31:27 +02:00
parent 446bad752f
commit 287cc92b2c
8 changed files with 54 additions and 30 deletions

View File

@@ -16,6 +16,7 @@
#include <assert.h>
#include <ctime>
#include <algorithm>
namespace Catch {
@@ -46,6 +47,14 @@ namespace Catch {
return std::string(timeStamp);
}
std::string fileNameTag(const std::vector<std::string> &tags) {
auto it = std::find_if(begin(tags),
end(tags),
[] (std::string const& tag) {return tag.front() == '#'; });
if (it != tags.end())
return it->substr(1);
return std::string();
}
}
class JunitReporter : public CumulativeReporterBase<JunitReporter> {
@@ -125,13 +134,6 @@ namespace Catch {
xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false );
}
static std::string fileNameTag( const std::set<std::string> &tags ) {
std::set<std::string>::const_iterator it = tags.lower_bound("#");
if( it != tags.end() && !it->empty() && it->front() == '#' )
return it->substr(1);
return std::string();
}
void writeTestCase( TestCaseNode const& testCaseNode ) {
TestCaseStats const& stats = testCaseNode.value;

View File

@@ -66,7 +66,7 @@ namespace Catch {
m_xml.startElement( "TestCase" )
.writeAttribute( "name", trim( testInfo.name ) )
.writeAttribute( "description", testInfo.description )
.writeAttribute( "tags", testInfo.tagsAsString );
.writeAttribute( "tags", testInfo.tagsAsString() );
writeSourceInfo( testInfo.lineInfo );