Comment why the return code is clamped

This commit is contained in:
Martin Hořeňovský 2018-01-12 11:49:48 +01:00
parent c053dca26e
commit 4575594bbf

View File

@ -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 ) {