]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: update to use DEFINE_TEST_MAIN_WITH_INTRO() macro 36838/head
authorZIHCO <chizobajames21@gmail.com>
Tue, 25 Mar 2025 16:11:46 +0000 (17:11 +0100)
committerLuca Boccassi <bluca@debian.org>
Wed, 26 Mar 2025 11:55:30 +0000 (11:55 +0000)
src/test/test-watch-pid.c

index 89cae36e50a57461164851260d755453e84d5baf..17dce05678540d2f629d089a6d85ab73d9326a8d 100644 (file)
@@ -7,14 +7,12 @@
 #include "service.h"
 #include "tests.h"
 
-int main(int argc, char *argv[]) {
+TEST_RET(watch_pid) {
         _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
         Unit *a, *b, *c, *u;
         int r;
 
-        test_setup_logging(LOG_DEBUG);
-
         if (getuid() != 0)
                 return log_tests_skipped("not root");
         r = enter_cgroup_subroot(NULL);
@@ -98,5 +96,12 @@ int main(int argc, char *argv[]) {
         unit_unwatch_pid(c, pid);
         ASSERT_NULL(manager_get_unit_by_pid(m, pid));
 
-        return 0;
+        return EXIT_SUCCESS;
+}
+
+static int intro(void) {
+        log_show_color(true);
+        return EXIT_SUCCESS;
 }
+
+DEFINE_TEST_MAIN_WITH_INTRO(LOG_DEBUG, intro);