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 listed = list( config() ) ) return static_cast( *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( runTests( m_config ).assertions.failed ) ); } catch( std::exception& ex ) {