Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2013-05-29 18:56:29 +0100
committerPhil Nash2013-05-29 18:56:29 +0100
commit20ddb0055f0c07f879962d2030a3ef6c8012d408 (patch)
tree02e1d6bfedc8f0f99d6bb3fe301775eefaeeebaa /include
parentc2ca80d9fb4d06e2893942bd061613115ade6bae (diff)
downloadcatch3-20ddb0055f0c07f879962d2030a3ef6c8012d408.tar.gz
ConfigData just keeps strings for test names/ specs/ tags (processed in Config actor)
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_commandline.hpp26
-rw-r--r--include/internal/catch_config.hpp29
2 files changed, 25 insertions, 30 deletions
diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp
index e0cccd70..3408c145 100644
--- a/include/internal/catch_commandline.hpp
+++ b/include/internal/catch_commandline.hpp
@@ -255,20 +255,8 @@ namespace Catch {
}
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
- std::string groupName;
- for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
- if( i != 0 )
- groupName += " ";
- groupName += cmd[i];
- }
- TestCaseFilters filters( groupName );
- for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
- if( startsWith( cmd[i], "[" ) || startsWith( cmd[i], "~[" ) )
- filters.addTags( cmd[i] );
- else
- filters.addFilter( TestCaseFilter( cmd[i] ) );
- }
- config.filters.push_back( filters );
+ for( std::size_t i = 0; i < cmd.argsCount(); ++i )
+ config.testsOrTags.push_back( cmd[i] );
}
};
@@ -301,16 +289,8 @@ namespace Catch {
}
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
- std::string groupName;
- for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
- if( i != 0 )
- groupName += " ";
- groupName += cmd[i];
- }
- TestCaseFilters filters( groupName );
for( std::size_t i = 0; i < cmd.argsCount(); ++i )
- filters.addTags( cmd[i] );
- config.filters.push_back( filters );
+ config.testsOrTags.push_back( cmd[i] );
}
};
diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp
index 9472a422..f29b58e1 100644
--- a/include/internal/catch_config.hpp
+++ b/include/internal/catch_config.hpp
@@ -65,7 +65,7 @@ namespace Catch {
std::string outputFilename;
std::string name;
- std::vector<TestCaseFilters> filters; // !TBD strings
+ std::vector<std::string> testsOrTags;
std::string stream;
};
@@ -84,9 +84,24 @@ namespace Catch {
Config( ConfigData const& data )
: m_data( data ),
- m_os( std::cout.rdbuf() ),
- m_filters( data.filters )
- {}
+ m_os( std::cout.rdbuf() )
+ {
+ std::string groupName;
+ for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) {
+ if( i != 0 )
+ groupName += " ";
+ groupName += data.testsOrTags[i];
+ }
+ TestCaseFilters filters( groupName );
+ for( std::size_t i = 0; i < data.testsOrTags.size(); ++i ) {
+ std::string filter = data.testsOrTags[i];
+ if( startsWith( filter, "[" ) || startsWith( filter, "~[" ) )
+ filters.addTags( filter );
+ else
+ filters.addFilter( TestCaseFilter( filter ) );
+ }
+ m_filterSets.push_back( filters );
+ }
virtual ~Config() {
m_os.rdbuf( std::cout.rdbuf() );
@@ -131,7 +146,7 @@ namespace Catch {
void addTestSpec( std::string const& testSpec ) {
TestCaseFilters filters( testSpec );
filters.addFilter( TestCaseFilter( testSpec ) );
- m_data.filters.push_back( filters );
+ m_filterSets.push_back( filters );
}
int abortAfter() const {
@@ -139,7 +154,7 @@ namespace Catch {
}
std::vector<TestCaseFilters> const& filters() const {
- return m_filters;
+ return m_filterSets;
}
// IConfig interface
@@ -154,7 +169,7 @@ namespace Catch {
Stream m_stream;
mutable std::ostream m_os;
- std::vector<TestCaseFilters> m_filters;
+ std::vector<TestCaseFilters> m_filterSets;
};