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
1 changed files with 6 additions and 1 deletions

View File

@ -315,9 +315,14 @@ namespace Catch {
}
void printTotals( const Totals& totals ) {
if( totals.assertions.total() == 0 ) {
if( totals.testCases.total() == 0 ) {
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 ) {
Colour colour( Colour::ResultError );
printCounts( "test case", totals.testCases );