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

Removed now redundant handling for missing assertions in test cases

- handled as part of sections
Commit
649f8c24b1b8b5f1aa6731dd87caf1665fcd967c
Author
Phil Nash ·
Parents
e8cf726a2348

Files · Download .tar.gz

Changes

 include/internal/catch_interfaces_reporter.h       |  3 ---
 include/internal/catch_legacy_reporter_adapter.hpp |  2 --
 include/internal/catch_runner_impl.hpp             | 10 ----------
 include/reporters/catch_reporter_console.hpp       |  6 ------
 4 files changed, 21 deletions(-)

diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h
index bf4d9a88..17a1c3d4 100644
--- a/include/internal/catch_interfaces_reporter.h
+++ b/include/internal/catch_interfaces_reporter.h
@@ -134,13 +134,11 @@ namespace Catch
                         Totals const& _totals,
                         std::string const& _stdOut,
                         std::string const& _stdErr,
-                        bool _missingAssertions,
                         bool _aborting )
         : testInfo( _testInfo ),
             totals( _totals ),
             stdOut( _stdOut ),
             stdErr( _stdErr ),
-            missingAssertions( _missingAssertions ),
             aborting( _aborting )
         {}
         virtual ~TestCaseStats();
@@ -149,7 +147,6 @@ namespace Catch
         Totals totals;
         std::string stdOut;
         std::string stdErr;
-        bool missingAssertions;
         bool aborting;
     };
 
diff --git a/include/internal/catch_legacy_reporter_adapter.hpp b/include/internal/catch_legacy_reporter_adapter.hpp
index d18ee58f..0911afa8 100644
--- a/include/internal/catch_legacy_reporter_adapter.hpp
+++ b/include/internal/catch_legacy_reporter_adapter.hpp
@@ -63,8 +63,6 @@ namespace Catch
         m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions );
     }
     void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) {
-        if( testCaseStats.missingAssertions )
-            m_legacyReporter->NoAssertionsInTestCase( testCaseStats.testInfo.name );
         m_legacyReporter->EndTestCase
             (   testCaseStats.testInfo,
                 testCaseStats.totals,
diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp
index ed51757c..7f763ab5 100644
--- a/include/internal/catch_runner_impl.hpp
+++ b/include/internal/catch_runner_impl.hpp
@@ -126,23 +126,13 @@ namespace Catch {
             while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() );
 
             Totals deltaTotals = m_totals.delta( prevTotals );
-            bool missingAssertions = false;
-            if( deltaTotals.assertions.total() == 0  && m_config->warnAboutMissingAssertions() ) {
-                m_totals.assertions.failed++;
-                deltaTotals = m_totals.delta( prevTotals );
-                missingAssertions = true;
-            }
-
             m_totals.testCases += deltaTotals.testCases;
-
             m_reporter->testCaseEnded( TestCaseStats(   testInfo,
                                                         deltaTotals,
                                                         redirectedCout,
                                                         redirectedCerr,
-                                                        missingAssertions,
                                                         aborting() ) );
 
-
             m_activeTestCase = NULL;
             m_testCaseTracker.reset();
 
diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp
index af3523de..af596078 100644
--- a/include/reporters/catch_reporter_console.hpp
+++ b/include/reporters/catch_reporter_console.hpp
@@ -73,12 +73,6 @@ namespace Catch {
         }
 
         virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) {
-
-            if( _testCaseStats.missingAssertions ) {
-                lazyPrint();
-                Colour colour( Colour::ResultError );
-                stream << "\nNo assertions in test case, '" << _testCaseStats.testInfo.name << "'\n" << std::endl;
-            }
             StreamingReporterBase::testCaseEnded( _testCaseStats );
             m_headerPrinted = false;
         }