#include <unistd.h>
#include <time.h>
#include <fnmatch.h>
-#include "server.h"
#include "test.h"
fprintf(stderr, "Unknown return value\n");
abort();
}
-
}
void create_core(void)
collection= world.collections;
if (world.create)
- world_ptr= world.create();
+ {
+ test_return_t error;
+ world_ptr= world.create(&error);
+ if (error != TEST_SUCCESS)
+ exit(1);
+ }
else
+ {
world_ptr= NULL;
+ }
if (argc > 1)
collection_to_run= argv[1];
}
- if (next->pre)
+ if (next->pre && world.runner->pre)
{
return_code= world.runner->pre(next->pre, world_ptr);
gettimeofday(&end_time, NULL);
load_time= timedif(end_time, start_time);
- if (next->post)
+ if (next->post && world.runner->post)
{
- (void) world.runner->pre(next->pre, world_ptr);
+ (void) world.runner->post(next->post, world_ptr);
}
if (world.post_run)
fprintf(stderr, "All tests completed successfully\n\n");
if (world.destroy)
- world.destroy(world_ptr);
+ {
+ 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
+ }
+ }
world_stats_print(&stats);