If no assertions print custom message

This commit is contained in:
Phil Nash 2013-11-12 19:06:08 +00:00
parent ecb9432763
commit 2f086ae255

View File

@ -315,9 +315,14 @@ namespace Catch {
} }
void printTotals( const Totals& totals ) { void printTotals( const Totals& totals ) {
if( totals.assertions.total() == 0 ) { if( totals.testCases.total() == 0 ) {
stream << "No tests ran"; stream << "No tests ran";
} }
else if( totals.assertions.total() == 0 ) {
Colour colour( Colour::Yellow );
printCounts( "test case", totals.testCases );
stream << " (no assertions)";
}
else if( totals.assertions.failed ) { else if( totals.assertions.failed ) {
Colour colour( Colour::ResultError ); Colour colour( Colour::ResultError );
printCounts( "test case", totals.testCases ); printCounts( "test case", totals.testCases );