mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Some tidy up
This commit is contained in:
parent
68eec929e4
commit
de77ff3b29
@ -61,7 +61,6 @@ namespace Catch
|
|||||||
m_config.stream() << "[Testing completed. ";
|
m_config.stream() << "[Testing completed. ";
|
||||||
ReportCounts( succeeded, failed );
|
ReportCounts( succeeded, failed );
|
||||||
m_config.stream() << "]" << std::endl;
|
m_config.stream() << "]" << std::endl;
|
||||||
(succeeded, failed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@ -156,10 +155,10 @@ namespace Catch
|
|||||||
virtual void EndTestCase( const TestCaseInfo& testInfo, const std::string& stdOut, const std::string& stdErr )
|
virtual void EndTestCase( const TestCaseInfo& testInfo, const std::string& stdOut, const std::string& stdErr )
|
||||||
{
|
{
|
||||||
if( !stdOut.empty() )
|
if( !stdOut.empty() )
|
||||||
m_config.stream() << "[stdout: " << stdOut << "]\n";
|
m_config.stream() << "[stdout: " << trim( stdOut ) << "]\n";
|
||||||
|
|
||||||
if( !stdErr.empty() )
|
if( !stdErr.empty() )
|
||||||
m_config.stream() << "[stderr: " << stdErr << "]\n";
|
m_config.stream() << "[stderr: " << trim( stdErr ) << "]\n";
|
||||||
|
|
||||||
m_config.stream() << "[Finished: " << testInfo.getName() << "]" << std::endl;
|
m_config.stream() << "[Finished: " << testInfo.getName() << "]" << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -168,14 +168,6 @@ namespace Catch
|
|||||||
m_stdErr << stdErr << "\n";
|
m_stdErr << stdErr << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string trim( const std::string& str )
|
|
||||||
{
|
|
||||||
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
|
|
||||||
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
|
|
||||||
|
|
||||||
return start < end ? str.substr( start, 1+end-start ) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void EndTesting( std::size_t /* succeeded */, std::size_t /* failed */ )
|
virtual void EndTesting( std::size_t /* succeeded */, std::size_t /* failed */ )
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ namespace Catch
|
|||||||
|
|
||||||
// create a T for use in sizeof expressions
|
// create a T for use in sizeof expressions
|
||||||
template<typename T> T Synth();
|
template<typename T> T Synth();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
|
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
|
@ -22,6 +22,16 @@
|
|||||||
|
|
||||||
namespace Catch
|
namespace Catch
|
||||||
{
|
{
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
static std::string trim( const std::string& str )
|
||||||
|
{
|
||||||
|
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
|
||||||
|
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
|
||||||
|
|
||||||
|
return start < end ? str.substr( start, 1+end-start ) : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class ReporterConfig
|
class ReporterConfig
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@ -167,7 +177,7 @@ namespace Catch
|
|||||||
{
|
{
|
||||||
ReporterRegistry::instance().registerReporter<T>( name );
|
ReporterRegistry::instance().registerReporter<T>( name );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CATCH_REGISTER_REPORTER( name, reporterType ) Catch::ReporterRegistrar<reporterType> INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ReporterReg )( name );
|
#define CATCH_REGISTER_REPORTER( name, reporterType ) Catch::ReporterRegistrar<reporterType> INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ReporterReg )( name );
|
||||||
|
Loading…
Reference in New Issue
Block a user