From eba08e936a807e0cae03c0d50160457f578b71aa Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 26 Jun 2019 19:53:58 +0300 Subject: [PATCH] Only return an 8 bit result from report_errors --- include/boost/core/lightweight_test.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/core/lightweight_test.hpp b/include/boost/core/lightweight_test.hpp index d2b322c..0f8274d 100644 --- a/include/boost/core/lightweight_test.hpp +++ b/include/boost/core/lightweight_test.hpp @@ -379,6 +379,7 @@ inline int report_errors() result.done(); int errors = result.errors(); + if( errors == 0 ) { BOOST_LIGHTWEIGHT_TEST_OSTREAM @@ -389,7 +390,9 @@ inline int report_errors() BOOST_LIGHTWEIGHT_TEST_OSTREAM << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl; } - return errors; + + // `return report_errors();` from main only supports 8 bit exit codes + return errors < 256? errors: 255; } } // namespace boost