Catches incorrect reporter name as per #107

This commit is contained in:
Phil Nash
2012-07-28 20:37:07 +01:00
parent b084562b3b
commit 61756974d0
3 changed files with 27 additions and 5 deletions

View File

@@ -36,6 +36,12 @@ namespace Catch {
Ptr<IReporter> reporter = getCurrentContext().getReporterRegistry().create( reporterName, reporterConfig );
if( !reporter )
{
std::cerr << "No reporter registered with name: " << reporterName << "'" << std::endl;
return (std::numeric_limits<int>::max)();
}
if( !config.data().stream.empty() ) {
if( config.data().stream[0] == '%' )
config.useStream( config.data().stream.substr( 1 ) );