Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

If no assertions print custom message

Commit
2f086ae25542a06f55bab3d217917c7d885282f6
Author
Phil Nash ·
Parents
ecb94327634e

Files · Download .tar.gz

Changes

 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 );