From 6871034931cf114e82e148965217b24fcfadc5f0 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 26 Jun 2019 19:31:54 +0300 Subject: [PATCH] Revert "report_errors with expected failures (#51)" This reverts commit 02041f6c9f94d9e5d69f7c36f08624e1001143a0 and https://github.com/boostorg/core/pull/51. Reason for revert: The change allows for incorrect result code returned from the process if the number of failures is a multiple of 256. This may result in test failures being taken as success by the parent process. --- include/boost/core/lightweight_test.hpp | 3 ++- test/Jamfile.v2 | 2 +- ...{lightweight_test_fail12.cpp => lightweight_test_test5.cpp} | 0 3 files changed, 3 insertions(+), 2 deletions(-) rename test/{lightweight_test_fail12.cpp => lightweight_test_test5.cpp} (100%) diff --git a/include/boost/core/lightweight_test.hpp b/include/boost/core/lightweight_test.hpp index d2b322c..468c2ff 100644 --- a/include/boost/core/lightweight_test.hpp +++ b/include/boost/core/lightweight_test.hpp @@ -383,13 +383,14 @@ inline int report_errors() { BOOST_LIGHTWEIGHT_TEST_OSTREAM << "No errors detected." << std::endl; + return 0; } else { BOOST_LIGHTWEIGHT_TEST_OSTREAM << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl; + return 1; } - return errors; } } // namespace boost diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index d912c1c..68e5f64 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -75,6 +75,7 @@ run lightweight_test_gt_ge_test.cpp ; run lightweight_test_eq_nullptr.cpp ; run lightweight_test_test3.cpp ; run lightweight_test_test4.cpp ; +run lightweight_test_test5.cpp ; run-fail lightweight_test_all_eq_test.cpp ; run-fail lightweight_test_all_with_fail.cpp ; @@ -92,7 +93,6 @@ run-fail lightweight_test_fail8.cpp : : : off : lightweight_test_fail8_no_ run-fail lightweight_test_fail9.cpp ; run-fail lightweight_test_fail10.cpp ; run-fail lightweight_test_fail11.cpp ; -run-fail lightweight_test_fail12.cpp ; run-fail lightweight_test_lt_fail.cpp ; run-fail lightweight_test_le_fail.cpp ; run-fail lightweight_test_gt_fail.cpp ; diff --git a/test/lightweight_test_fail12.cpp b/test/lightweight_test_test5.cpp similarity index 100% rename from test/lightweight_test_fail12.cpp rename to test/lightweight_test_test5.cpp