From 4873aad0fe15b3f46c6372b661ce926795922a6e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 23 Aug 2007 20:17:52 +0000 Subject: The list now supports insertSorted, and the UnitSuite supports more options, including StopOnError and handling/reporting of external exceptions. --- src/unitsuite.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/unitsuite.cpp') diff --git a/src/unitsuite.cpp b/src/unitsuite.cpp index 2a28eb5..b61f486 100644 --- a/src/unitsuite.cpp +++ b/src/unitsuite.cpp @@ -1,6 +1,12 @@ #include "unitsuite.h" -Bu::UnitSuite::UnitSuite() +Bu::UnitSuite::UnitSuite() : + iOptions( 0 ) +{ +} + +Bu::UnitSuite::UnitSuite( int iOptions ) : + iOptions( iOptions ) { } @@ -35,10 +41,23 @@ int Bu::UnitSuite::run( int argc, char *argv[] ) e.str.getStr() ); } + + if( (iOptions & optStopOnError) ) + return 0; + } + catch( std::exception &e ) + { + printf("failed with unknown exception. what: %s\n", e.what() ); + + if( (iOptions & optStopOnError) ) + return 0; } catch( ... ) { printf("failed with external exception.\n"); + + if( (iOptions & optStopOnError) ) + return 0; } } -- cgit v1.2.3