Removed stream name from config

This commit is contained in:
Phil Nash 2013-05-29 19:06:25 +01:00
parent 3f184e22e8
commit 40e529740c
5 changed files with 323 additions and 419 deletions

View File

@ -76,9 +76,6 @@ namespace Catch {
private:
void openStream() {
if( !m_config->getStreamName().empty() )
m_config->useStream( m_config->getStreamName() );
// Open output file, if specified
if( !m_config->getFilename().empty() ) {
m_ofs.open( m_config->getFilename().c_str() );

View File

@ -413,10 +413,7 @@ namespace Catch {
"OutputDebugString is supported).";
}
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
if( cmd[0][0] == '%' )
config.stream = cmd[0].substr( 1 );
else
config.outputFilename = cmd[0];
config.outputFilename = cmd[0];
}
};

View File

@ -69,8 +69,6 @@ namespace Catch {
std::string name;
std::vector<std::string> testsOrTags;
std::string stream;
};
@ -142,8 +140,6 @@ namespace Catch {
m_stream = stream;
}
std::string getStreamName() const { return m_data.stream; }
std::string getReporterName() const { return m_data.reporter; }
void addTestSpec( std::string const& testSpec ) {

File diff suppressed because it is too large Load Diff

View File

@ -256,20 +256,12 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) {
}
}
SECTION( "streams", "" ) {
SECTION( "output filename", "" ) {
SECTION( "-o filename", "" ) {
const char* argv[] = { "test", "-o", "filename.ext" };
CHECK_NOTHROW( parseIntoConfig( argv, config ) );
REQUIRE( config.outputFilename == "filename.ext" );
REQUIRE( config.stream.empty() );
}
SECTION( "-o %stdout", "" ) {
const char* argv[] = { "test", "-o", "%stdout" };
CHECK_NOTHROW( parseIntoConfig( argv, config ) );
REQUIRE( config.stream == "stdout" );
REQUIRE( config.outputFilename.empty() );
}
SECTION( "--out", "" ) {
const char* argv[] = { "test", "--out", "filename.ext" };