- { // Runner Code
- gettimeofday(&start_time, NULL);
- return_code= world.runner->run(run->test_fn, world_ptr);
- gettimeofday(&end_time, NULL);
- load_time= timedif(end_time, start_time);
+ if (test_success(return_code= world->item.startup(world_ptr)))
+ {
+ if (test_success(return_code= world->item.flush(world_ptr, run)))
+ {
+ // @note pre will fail is SKIPPED is returned
+ if (test_success(return_code= world->item.pre(world_ptr)))
+ {
+ { // Runner Code
+ gettimeofday(&start_time, NULL);
+ return_code= world->runner->run(run->test_fn, world_ptr);
+ gettimeofday(&end_time, NULL);
+ load_time= timedif(end_time, start_time);
+ }
+ }
+
+ // @todo do something if post fails
+ (void)world->item.post(world_ptr);
+ }
+ else
+ {
+ std::cerr << __FILE__ << ":" << __LINE__ << " item.flush(failure)" << std::endl;
+ }
+ }
+ else
+ {
+ std::cerr << __FILE__ << ":" << __LINE__ << " item.startup(failure)" << std::endl;