Make TagInfo non-local

This commit is contained in:
Phil Nash 2014-05-20 19:02:10 +01:00
parent 9241e436f9
commit d12c00666a

View File

@ -75,6 +75,24 @@ namespace Catch {
return matchedTests; return matchedTests;
} }
struct TagInfo {
TagInfo() : count ( 0 ) {}
void add( std::string const& spelling ) {
++count;
spellings.insert( spelling );
}
std::string all() const {
std::string out;
for( std::set<std::string>::const_iterator it = spellings.begin(), itEnd = spellings.end();
it != itEnd;
++it )
out += "[" + *it + "]";
return out;
}
std::set<std::string> spellings;
std::size_t count;
};
inline std::size_t listTags( Config const& config ) { inline std::size_t listTags( Config const& config ) {
TestSpec testSpec = config.testSpec(); TestSpec testSpec = config.testSpec();
if( config.testSpec().hasFilters() ) if( config.testSpec().hasFilters() )
@ -84,23 +102,6 @@ namespace Catch {
testSpec = TestSpecParser().parse( "*" ).testSpec(); testSpec = TestSpecParser().parse( "*" ).testSpec();
} }
struct TagInfo {
TagInfo() : count ( 0 ) {}
void add( std::string const& spelling ) {
++count;
spellings.insert( spelling );
}
std::string all() const {
std::string out;
for( std::set<std::string>::const_iterator it = spellings.begin(), itEnd = spellings.end();
it != itEnd;
++it )
out += "[" + *it + "]";
return out;
}
std::set<std::string> spellings;
std::size_t count;
};
std::map<std::string, TagInfo> tagCounts; std::map<std::string, TagInfo> tagCounts;
std::vector<TestCase> matchedTestCases; std::vector<TestCase> matchedTestCases;