]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/libsystemd/sd-bus/test-bus-chat.c
tests: add helper to unify skipping a test and exiting
[thirdparty/systemd.git] / src / libsystemd / sd-bus / test-bus-chat.c
index f3ff856e42c80192ca9c58b98aa3838f7b2aaadd..28922e6a699eb7ebc3fe387ef1bc27c4d2d372c7 100644 (file)
@@ -16,6 +16,7 @@
 #include "format-util.h"
 #include "log.h"
 #include "macro.h"
+#include "tests.h"
 #include "util.h"
 
 static int match_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
@@ -510,10 +511,8 @@ int main(int argc, char *argv[]) {
         int q, r;
 
         r = server_init(&bus);
-        if (r < 0) {
-                log_info("Failed to connect to bus, skipping tests.");
-                return EXIT_TEST_SKIP;
-        }
+        if (r < 0)
+                return log_tests_skipped("Failed to connect to bus");
 
         log_info("Initialized...");