]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal/test-journal.c
tests: add helper to unify skipping a test and exiting
[thirdparty/systemd.git] / src / journal / test-journal.c
index 3cdaad4b4039ce6b8ebd25a8ba879badca9a109c..7e188420db0cc54b21dab2d3bbe87da9f591a725 100644 (file)
@@ -8,6 +8,7 @@
 #include "journal-vacuum.h"
 #include "log.h"
 #include "rm-rf.h"
+#include "tests.h"
 
 static bool arg_keep = false;
 
@@ -239,10 +240,8 @@ int main(int argc, char *argv[]) {
         arg_keep = argc > 1;
 
         /* journal_file_open requires a valid machine id */
-        if (access("/etc/machine-id", F_OK) != 0) {
-                log_info("/etc/machine-id not found, skipping tests.");
-                return EXIT_TEST_SKIP;
-        }
+        if (access("/etc/machine-id", F_OK) != 0)
+                return log_tests_skipped("/etc/machine-id not found");
 
         test_non_empty();
         test_empty();