]> git.ipfire.org Git - pakfire.git/commitdiff
testsuite: Pakfire context needs to be initialized to set the logging function
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 9 Mar 2019 17:01:42 +0000 (17:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 9 Mar 2019 17:01:42 +0000 (17:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/testsuite.c

index 0bdece7a644b8313377f11ab573841cc6d5506a6..4a9992e35845e4c8f2dd8545f00ad92fa4cb0ff7 100644 (file)
@@ -31,9 +31,6 @@ int testsuite_init() {
        if (r)
                return r;
 
-       // Log to stderr
-       pakfire_log_set_function(pakfire_log_stderr);
-
        return 0;
 }
 
@@ -43,6 +40,9 @@ static int test_run(test_t* t) {
        t->pakfire = pakfire_create(TEST_ROOTFS, NULL);
        assert_return(t->pakfire, EXIT_FAILURE);
 
+       // Log to stderr
+       pakfire_log_set_function(t->pakfire, pakfire_log_stderr);
+
        int r = t->func(t);
        if (r)
                LOG("Test failed with error code: %d\n", r);