- gettimeofday(&start_time, NULL);
- failed= run->function(memc);
- gettimeofday(&end_time, NULL);
- long int load_time= timedif(end_time, start_time);
- if (failed)
- fprintf(stderr, "\t\t\t\t\t %ld.%03ld [ failed ]\n", load_time / 1000,
- load_time % 1000);
- else
- fprintf(stderr, "\t\t\t\t\t %ld.%03ld [ ok ]\n", load_time / 1000,
- load_time % 1000);
-
- if (next->post)
- (void)next->post(memc);
-
- assert(memc);
-error:
- memcached_free(memc);
+ fprintf(stderr, "[ %s ]\n", test_strerror(return_code));
+
+ if (world.test.on_error)
+ {
+ test_return_t rc;
+ rc= world.test.on_error(return_code, world_ptr);
+
+ if (rc != TEST_SUCCESS)
+ break;
+ }
+ }
+
+ if (next->post && world.runner->post)
+ {
+ (void) world.runner->post(next->post, world_ptr);
+ }
+
+ if (! failed && ! skipped)
+ {
+ stats.collection_success++;
+ }
+cleanup:
+
+ world.collection.shutdown(world_ptr);
+ }
+
+ if (stats.collection_failed || stats.collection_skipped)
+ {
+ fprintf(stderr, "Some test failures and/or skipped test occurred.\n\n");
+ }
+ else
+ {
+ fprintf(stderr, "All tests completed successfully\n\n");
+ }
+
+ if (world.destroy)
+ {
+ test_return_t error;
+ error= world.destroy(world_ptr);
+
+ if (error != TEST_SUCCESS)
+ {
+ fprintf(stderr, "Failure during shutdown.\n");
+ stats.failed++; // We do this to make our exit code return 1