tests: make is_run_on_travis_ci() static

This is a pretty specific hack, so let's just define it close to the one
place where it is used.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-11-08 16:40:11 +01:00
parent 5eecb1030f
commit 2025f0f602
3 changed files with 5 additions and 9 deletions

View 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;

View 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");
}

View 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);