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

TAP Reporter: count success tests even if not printed

This fixes a bug whereas running the TAP reporter without the -s switch
causes the reporter to print 1..0.
Commit
da023b2f9ac516b17928f8ae804416712e72d937
Author
Pietro Cerutti ·
Parents
470561cbbd34

Files · Download .tar.gz

Changes

 include/reporters/catch_reporter_tap.hpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/reporters/catch_reporter_tap.hpp b/include/reporters/catch_reporter_tap.hpp
index 16e8a7fe..36e4f901 100644
--- a/include/reporters/catch_reporter_tap.hpp
+++ b/include/reporters/catch_reporter_tap.hpp
@@ -46,6 +46,7 @@ namespace Catch {
 
         virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
             AssertionResult const& result = _assertionStats.assertionResult;
+            ++counter;
 
             bool printInfoMessages = true;
 
@@ -56,7 +57,7 @@ namespace Catch {
                 printInfoMessages = false;
             }
 
-            AssertionPrinter printer( stream, _assertionStats, printInfoMessages, ++counter );
+            AssertionPrinter printer( stream, _assertionStats, printInfoMessages, counter );
             printer.print();
             stream << " # " << currentTestCaseInfo->name ;
 
@@ -75,7 +76,7 @@ namespace Catch {
         class AssertionPrinter {
             void operator= ( AssertionPrinter const& );
         public:
-            AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages, size_t counter = 0 )
+            AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages, size_t counter )
             : stream( _stream )
             , stats( _stats )
             , result( _stats.assertionResult )