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

Comment why the return code is clamped

Commit
4575594bbfde89e698770333fe9e1d53ba3206ae
Author
Martin Hořeňovský ·
Parents
c053dca26e01

Files · Download .tar.gz

Changes

 include/internal/catch_session.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/internal/catch_session.cpp b/include/internal/catch_session.cpp
index b1c00d05..1d3ce06e 100644
--- a/include/internal/catch_session.cpp
+++ b/include/internal/catch_session.cpp
@@ -259,6 +259,9 @@ namespace Catch {
             if( Option<std::size_t> listed = list( config() ) )
                 return static_cast<int>( *listed );
 
+            // Note that on unices only the lower 8 bits are usually used, clamping
+            // the return value to 255 prevents false negative when some multiple
+            // of 256 tests has failed
             return (std::min)( MaxExitCode, static_cast<int>( runTests( m_config ).assertions.failed ) );
         }
         catch( std::exception& ex ) {