X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fcollection.cc;h=717847eb8d6537937576a52eabb4a91a24ed1290;hb=4db614a7b66e3a293b484f8d853b4f5892d2d1d8;hp=c6fec1ebd8d57250700aa29a30d6e8dc70f17d90;hpb=bce9a74e8addd1085b2e751508bf9ab0c2e84e45;p=awesomized%2Flibmemcached diff --git a/libtest/collection.cc b/libtest/collection.cc index c6fec1eb..717847eb 100644 --- a/libtest/collection.cc +++ b/libtest/collection.cc @@ -38,7 +38,7 @@ #include -static test_return_t runner_code(Framework* frame, +static test_return_t runner_code(libtest::Framework* frame, test_st* run, libtest::Timer& _timer) { // Runner Code @@ -84,23 +84,22 @@ Collection::Collection(Framework* frame_arg, _success(0), _skipped(0), _failed(0), - _total(0) + _total(0), + _formatter(_name) { fatal_assert(arg); } test_return_t Collection::exec() { - Out << "Collection: " << _name; - if (test_success(_frame->runner()->pre(_pre, _frame->creators_ptr()))) { for (test_st *run= _tests; run->name; run++) { - long int load_time= 0; - + formatter()->push_testcase(run->name); if (_frame->match(run->name)) { + formatter()->skipped(); continue; } _total++; @@ -114,6 +113,7 @@ test_return_t Collection::exec() { Error << "frame->runner()->flush(creators_ptr)"; _skipped++; + formatter()->skipped(); continue; } } @@ -122,31 +122,27 @@ test_return_t Collection::exec() } catch (libtest::fatal &e) { - Error << "Fatal exception was thrown: " << e.what(); - return_code= TEST_FAILURE; + stream::cerr(e.file(), e.line(), e.func()) << e.what(); _failed++; + formatter()->failed(); throw; } switch (return_code) { case TEST_SUCCESS: - Out << "\tTesting " - << run->name - << "\t\t\t\t\t" - << _timer - << " [ " << test_strerror(return_code) << " ]"; _success++; + formatter()->success(_timer); break; case TEST_FAILURE: _failed++; - Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]"; + formatter()->failed(); break; case TEST_SKIPPED: _skipped++; - Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]"; + formatter()->skipped(); break; default: