int pakfire_log_get_priority();
void pakfire_log_set_priority(int priority);
+void pakfire_log_stderr(int priority, const char* file,
+ int line, const char* fn, const char* format, va_list args);
+void pakfire_log_syslog(int priority, const char* file,
+ int line, const char* fn, const char* format, va_list args);
+
#ifdef PAKFIRE_PRIVATE
typedef struct pakfire_logging_config {
pakfire_log_get_priority;
pakfire_log_set_function;
pakfire_log_set_priority;
+ pakfire_log_stderr;
+ pakfire_log_syslog;
# package
pakfire_package_add_conflicts;
}
int main(int argc, char** argv) {
+ testsuite_init();
+
testsuite_t* ts = testsuite_create(1);
testsuite_add_test(ts, "test_init", test_init);
#include "testsuite.h"
+#include <pakfire/logging.h>
+#include <pakfire/pakfire.h>
+
+int testsuite_init() {
+ // Initialize the pakfire library
+ int r = pakfire_init();
+ if (r)
+ return r;
+
+ // Log to stderr
+ pakfire_log_set_function(pakfire_log_stderr);
+}
+
int test_run(const test_t* t) {
LOG("running %s\n", t->name);
size_t left;
} testsuite_t;
+int testsuite_init();
testsuite_t* testsuite_create(size_t n);
int testsuite_add_test(testsuite_t* ts, const char* name, test_function_t func);
int testsuite_run(testsuite_t* ts);