From 2f086ae25542a06f55bab3d217917c7d885282f6 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Tue, 12 Nov 2013 19:06:08 +0000 Subject: [PATCH] If no assertions print custom message --- include/reporters/catch_reporter_console.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 816f4214..7d9ec684 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -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 );