]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-watch-pid.c
tests: add helper to unify skipping a test and exiting
[thirdparty/systemd.git] / src / test / test-watch-pid.c
index 4e349ab927b5302853b130f7138b22e546f0e65e..615ded186bf286d08810c224781b3b443f33f935 100644 (file)
@@ -17,16 +17,11 @@ int main(int argc, char *argv[]) {
         log_parse_environment();
         log_open();
 
-        if (getuid() != 0) {
-                log_notice("Not running as root, skipping kernel related tests.");
-                return EXIT_TEST_SKIP;
-        }
-
+        if (getuid() != 0)
+                return log_tests_skipped("not root");
         r = enter_cgroup_subroot();
-        if (r == -ENOMEDIUM) {
-                log_notice("cgroupfs not available, skipping tests");
-                return EXIT_TEST_SKIP;
-        }
+        if (r == -ENOMEDIUM)
+                return log_tests_skipped("cgroupfs not available");
 
         assert_se(set_unit_path(get_testdata_dir()) >= 0);
         assert_se(runtime_dir = setup_fake_runtime_dir());