55 */
66
77#include " Common/Cpp/ScopeExit.h"
8+ #include " Common/Cpp/PrettyPrint.h"
89#include " Common/Cpp/TestRunners/UnitTestDatabase.h"
910#include " CommonFramework/Globals.h"
1011#include " CommonFramework/ProgramStats/StatsTracking.h"
@@ -229,7 +230,7 @@ void UnitTestRunner::on_test_finished(
229230
230231
231232
232- void CommandLineUnitTestRunner::run (){
233+ bool CommandLineUnitTestRunner::run (){
233234 PokemonAutomation::UnitTestRunner runner (
234235 m_logger,
235236 GlobalThreadPools::computation_normal ()
@@ -239,6 +240,14 @@ void CommandLineUnitTestRunner::run(){
239240 runner.add_test (test.second );
240241 }
241242 runner.run ();
243+
244+ m_logger.log (
245+ " Tests Finished:"
246+ " \n Passed: " + tostr_u_commas (m_passed_tests.load (std::memory_order_acquire)) +
247+ " \n Failed: " + tostr_u_commas (m_failed_tests.load (std::memory_order_acquire)) +
248+ " \n Skipped: " + tostr_u_commas (m_skipped_tests.load (std::memory_order_acquire))
249+ );
250+ return m_failed_tests.load (std::memory_order_acquire) != 0 ;
242251}
243252void CommandLineUnitTestRunner::on_test_finished (
244253 std::shared_ptr<const UnitTest> test,
@@ -247,18 +256,23 @@ void CommandLineUnitTestRunner::on_test_finished(
247256 switch (result.result ){
248257 case UnitTestResult::NOT_RUN :
249258 m_logger.log (" NOT RUN: " + test->name (), COLOR_ORANGE );
259+ m_skipped_tests++;
250260 break ;
251261 case UnitTestResult::PASSED :
252262 m_logger.log (" PASSED: " + test->name (), COLOR_BLUE );
263+ m_passed_tests++;
253264 break ;
254265 case UnitTestResult::FAILED :
255266 m_logger.log (" FAILED: " + test->name (), COLOR_RED );
267+ m_failed_tests++;
256268 break ;
257269 case UnitTestResult::SKIPPED :
258270 m_logger.log (" SKIPPED: " + test->name (), COLOR_ORANGE );
271+ m_skipped_tests++;
259272 break ;
260273 case UnitTestResult::OOM :
261274 m_logger.log (" OOM: " + test->name (), COLOR_RED );
275+ m_failed_tests++;
262276 break ;
263277 }
264278}
0 commit comments