]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-helper.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / test / test-helper.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 Copyright © 2013 Holger Hans Peter Freyther
6 ***/
7
8 #include "sd-daemon.h"
9
10 #include "macro.h"
11
12 #define TEST_REQ_RUNNING_SYSTEMD(x) \
13 if (sd_booted() > 0) { \
14 x; \
15 } else { \
16 printf("systemd not booted skipping '%s'\n", #x); \
17 }
18
19 #define MANAGER_SKIP_TEST(r) \
20 IN_SET(r, \
21 -EPERM, \
22 -EACCES, \
23 -EADDRINUSE, \
24 -EHOSTDOWN, \
25 -ENOENT, \
26 -ENOMEDIUM /* cannot determine cgroup */ \
27 )
28
29 int enter_cgroup_subroot(void);
30
31 bool is_run_on_travis_ci(void);