pakfire_log_set_function(pakfire_log_stderr);
}
-int test_run(const test_t* t) {
+static int test_run(const test_t* t) {
LOG("running %s\n", t->name);
int r = t->func(t);
+ if (r)
+ LOG("Test failed with error code: %d\n", r);
return r;
}
int testsuite_add_test(testsuite_t* ts, const char* name, test_function_t func);
int testsuite_run(testsuite_t* ts);
-int test_run(const test_t* t);
-
#define _LOG(prefix, fmt, ...) printf("TESTS: " prefix fmt, ## __VA_ARGS__);
#define LOG(fmt, ...) _LOG("", fmt, ## __VA_ARGS__);
#define LOG_WARN(fmt, ...) _LOG("WARN: ", fmt, ## __VA_ARGS__);