-f supports quoted test names (test name surrounded with " characters).

This is the first part to resolving #717
This commit is contained in:
Phil Nash 2016-09-27 10:27:28 +01:00
parent c23b374f3d
commit b1eeec7c69
2 changed files with 9 additions and 2 deletions

View File

@ -85,8 +85,11 @@ namespace Catch {
std::string line;
while( std::getline( f, line ) ) {
line = trim(line);
if( !line.empty() && !startsWith( line, "#" ) )
addTestOrTags( config, "\"" + line + "\"," );
if( !line.empty() && !startsWith( line, "#" ) ) {
if( !startsWith( line, "\"" ) )
line = "\"" + line + "\"";
addTestOrTags( config, line + "," );
}
}
}

View File

@ -483,3 +483,7 @@ TEST_CASE( "This test 'should' fail but doesn't", "[.][failing][!shouldfail]" )
{
SUCCEED( "oops!" );
}
TEST_CASE( "# A test name that starts with a #" ) {
SUCCEED( "yay" );
}