From 4924707a488b830c28f94e2e23a223715a8c03a0 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 29 Jul 2013 14:55:02 -0700 Subject: [PATCH] Report summary for unit tests --- TODO.txt | 12 +++--------- modules/ripple_app/main/ripple_Main.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/TODO.txt b/TODO.txt index 5f37f182de..0a5bf27bc3 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,10 +5,6 @@ RIPPLE TODO Vinnie's List: Changes day to day, descending priority (Items marked '*' can be handled by others.) -- Allow skipped/disabled unit tests and reporting. -- Show summary for text output of unit test results -- Make ProofOfWorkTests manual since they aren't used - - Do something about the throw() reporting weaknesses: * Make sure all Sconstruct and .pro builds have debug symbols in release * Replace all throw with beast::Throw() @@ -21,6 +17,7 @@ Vinnie's List: Changes day to day, descending priority - Implement getStackBacktrace for BEAST_BSD targets - Add UnhandledExceptionCatcher to beast - Return EXIT_FAILURE on unhandled exception + - Finish unit tests and code for Validators * Document the command line options for the beast unit test framework - Tidy up all the loose files at the root of the repository @@ -29,15 +26,12 @@ Vinnie's List: Changes day to day, descending priority - Refactor Section code into ConfigFile - Improved Mutex to track deadlocks - Work on KeyvaDB +- Allow skipped/disabled unit tests and reporting. - - -David Feature: +David Features: - override config items from command line - change config via RPC, this is for debugging - - -------------------------------------------------------------------------------- - Add convenience variadic functions to JobQueue that do the bind for you diff --git a/modules/ripple_app/main/ripple_Main.cpp b/modules/ripple_app/main/ripple_Main.cpp index 12ca64581a..37b81bc4f5 100644 --- a/modules/ripple_app/main/ripple_Main.cpp +++ b/modules/ripple_app/main/ripple_Main.cpp @@ -206,6 +206,17 @@ static int runUnitTests (String const& whichTests, String const& format) } else { + UnitTests::Results const& r (tr.getResults ()); + + String s; + + s << "Summary: " << + String (r.suites.size ()) << " suites, " << + String (r.cases) << " cases, " << + String (r.tests) << " tests, " << + String (r.failures) << " failure" << ((r.failures != 1) ? "s" : "") << "."; + + tr.logMessage (s); } return tr.anyTestsFailed () ? EXIT_FAILURE : EXIT_SUCCESS;