]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: make is_run_on_travis_ci() static
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 8 Nov 2019 15:40:11 +0000 (16:40 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Nov 2019 13:55:57 +0000 (14:55 +0100)
This is a pretty specific hack, so let's just define it close to the one
place where it is used.

src/test/test-execute.c
src/test/test-helper.c
src/test/test-helper.h

index 57a4b1c28247c6a161ce7776497a7a5911f0831f..957cc2e384752a8d189c657609087dca8939de80 100644 (file)
@@ -37,6 +37,11 @@ static int cld_dumped_to_killed(int code) {
         return code == CLD_DUMPED ? CLD_KILLED : code;
 }
 
+_unused_ static bool is_run_on_travis_ci(void) {
+        /* https://docs.travis-ci.com/user/environment-variables#default-environment-variables */
+        return streq_ptr(getenv("TRAVIS"), "true");
+}
+
 static void wait_for_service_finish(Manager *m, Unit *unit) {
         Service *service = NULL;
         usec_t ts;
index dc8c80a14b7614953130b7dc38e6b0e41b84f916..9e9de0132fa4f2e43f7a7b0c101de1fba0e33079 100644 (file)
@@ -28,8 +28,3 @@ int enter_cgroup_subroot(void) {
 
         return cg_attach_everywhere(supported, cgroup_subroot, 0, NULL, NULL);
 }
-
-/* https://docs.travis-ci.com/user/environment-variables#default-environment-variables */
-bool is_run_on_travis_ci(void) {
-        return streq_ptr(getenv("TRAVIS"), "true");
-}
index 81e19ee2071c3192eeaeec8aec87f1731917f5cb..6e886ae3de5a27a1cdb480740dfd6535283704ce 100644 (file)
@@ -5,8 +5,6 @@
   Copyright © 2013 Holger Hans Peter Freyther
 ***/
 
-#include <stdbool.h>
-
 #include "sd-daemon.h"
 
 #define TEST_REQ_RUNNING_SYSTEMD(x)                                 \
@@ -17,5 +15,3 @@
         }
 
 int enter_cgroup_subroot(void);
-
-bool is_run_on_travis_ci(void);