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,15 +75,6 @@ namespace Catch {
return matchedTests; return matchedTests;
} }
inline std::size_t listTags( Config const& config ) {
TestSpec testSpec = config.testSpec();
if( config.testSpec().hasFilters() )
std::cout << "Tags for matching test cases:\n";
else {
std::cout << "All available tags:\n";
testSpec = TestSpecParser().parse( "*" ).testSpec();
}
struct TagInfo { struct TagInfo {
TagInfo() : count ( 0 ) {} TagInfo() : count ( 0 ) {}
void add( std::string const& spelling ) { void add( std::string const& spelling ) {
@ -101,6 +92,16 @@ namespace Catch {
std::set<std::string> spellings; std::set<std::string> spellings;
std::size_t count; std::size_t count;
}; };
inline std::size_t listTags( Config const& config ) {
TestSpec testSpec = config.testSpec();
if( config.testSpec().hasFilters() )
std::cout << "Tags for matching test cases:\n";
else {
std::cout << "All available tags:\n";
testSpec = TestSpecParser().parse( "*" ).testSpec();
}
std::map<std::string, TagInfo> tagCounts; std::map<std::string, TagInfo> tagCounts;
std::vector<TestCase> matchedTestCases; std::vector<TestCase> matchedTestCases;