X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fcollection.cc;h=86e7f864a922c4034cf29f32b1495d660be9bcd0;hb=b30da3e793829246675966830c668c3f60496e07;hp=b3bdbdeee69548e43776e62340292642e4e83e76;hpb=fde9567090d20b035433241720f00cfbe6e66bf2;p=m6w6%2Flibmemcached diff --git a/libtest/collection.cc b/libtest/collection.cc index b3bdbdee..86e7f864 100644 --- a/libtest/collection.cc +++ b/libtest/collection.cc @@ -38,6 +38,7 @@ #include +// @todo possibly have this code fork off so if it fails nothing goes bad static test_return_t runner_code(libtest::Framework* frame, test_st* run, libtest::Timer& _timer) @@ -50,11 +51,11 @@ static test_return_t runner_code(libtest::Framework* frame, try { _timer.reset(); - return_code= frame->runner()->run(run->test_fn, frame->creators_ptr()); + return_code= frame->runner()->main(run->test_fn, frame->creators_ptr()); } // Special case where check for the testing of the exception // system. - catch (libtest::fatal &e) + catch (const libtest::fatal& e) { if (libtest::fatal::is_disabled()) { @@ -92,7 +93,7 @@ Collection::Collection(Framework* frame_arg, test_return_t Collection::exec() { - if (test_success(_frame->runner()->pre(_pre, _frame->creators_ptr()))) + if (test_success(_frame->runner()->setup(_pre, _frame->creators_ptr()))) { for (test_st *run= _tests; run->name; run++) { @@ -132,7 +133,7 @@ test_return_t Collection::exec() } libtest::cancel_alarm(); } - catch (libtest::fatal &e) + catch (const libtest::fatal& e) { stream::cerr(e.file(), e.line(), e.func()) << e.what(); _failed++; @@ -158,14 +159,14 @@ test_return_t Collection::exec() break; default: - fatal_message("invalid return code"); + FATAL("invalid return code"); } #if 0 @TODO add code here to allow for a collection to define a method to reset to allow tests to continue. #endif } - (void) _frame->runner()->post(_post, _frame->creators_ptr()); + (void) _frame->runner()->teardown(_post, _frame->creators_ptr()); } if (_failed == 0 and _skipped == 0 and _success)