try {
if (test_success(return_code= world.item.startup(creators_ptr)))
{
- if (test_success(return_code= world.item.flush(creators_ptr, run)))
+ if (run->requires_flush)
{
- // @note pre will fail is SKIPPED is returned
- if (test_success(return_code= world.item.pre(creators_ptr)))
- {
- { // Runner Code
- gettimeofday(&start_time, NULL);
- assert(world.runner());
- assert(run->test_fn);
- try
+ return_code= world.runner()->flush(creators_ptr);
+ }
+
+ if (test_success(return_code))
+ {
+ { // Runner Code
+ gettimeofday(&start_time, NULL);
+ assert(world.runner());
+ assert(run->test_fn);
+ try
+ {
+ return_code= world.runner()->run(run->test_fn, creators_ptr);
+ }
+ // Special case where check for the testing of the exception
+ // system.
+ catch (libtest::fatal &e)
+ {
+ if (fatal::is_disabled())
{
- return_code= world.runner()->run(run->test_fn, creators_ptr);
+ fatal::increment_disabled_counter();
+ return_code= TEST_SUCCESS;
}
- // Special case where check for the testing of the exception
- // system.
- catch (libtest::fatal &e)
+ else
{
- if (fatal::is_disabled())
- {
- fatal::increment_disabled_counter();
- return_code= TEST_SUCCESS;
- }
- else
- {
- throw;
- }
+ throw;
}
-
- gettimeofday(&end_time, NULL);
- load_time= timedif(end_time, start_time);
}
- }
- // @todo do something if post fails
- (void)world.item.post(creators_ptr);
+ gettimeofday(&end_time, NULL);
+ load_time= timedif(end_time, start_time);
+ }
}
else if (return_code == TEST_SKIPPED)
{ }
{
std::cerr << e.what() << std::endl;
}
+ catch (libtest::disconnected& e)
+ {
+ std::cerr << "Unhandled disconnection occurred:" << e.what() << std::endl;
+ }
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;