summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-26 21:07:46 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-26 23:50:44 -0400
commit49e5de64e22ea4794092b91393545ab08e658e0a (patch)
treed3f49aed0bd01890f4a60f773d8fdda412f65d94 /src/test
parentf7703533a4d6bac9ba708218a3244cdc60376446 (diff)
tests: skip bus test if bus cannot be opened
To make the result more visible, special return value is used to tell automake that the test was skipped. While at it, use the same return value in other skipped tests.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-sched-prio.c4
-rw-r--r--src/test/test-unit-name.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test-sched-prio.c b/src/test/test-sched-prio.c
index c57f6a3671..ba0aacf79d 100644
--- a/src/test/test-sched-prio.c
+++ b/src/test/test-sched-prio.c
@@ -22,7 +22,7 @@
#include <sched.h>
#include "manager.h"
-
+#include "macro.h"
int main(int argc, char *argv[]) {
Manager *m;
@@ -37,7 +37,7 @@ int main(int argc, char *argv[]) {
r = manager_new(SYSTEMD_USER, &m);
if (r == -EPERM) {
puts("manager_new: Permission denied. Skipping test.");
- return EXIT_SUCCESS;
+ return EXIT_TEST_SKIP;
}
assert(r >= 0);
assert_se(manager_startup(m, serial, fdset) >= 0);
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 0b6b56394e..aba36e4df1 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -108,7 +108,7 @@ static void test_replacements(void) {
#undef expect
}
-static void test_unit_printf(void) {
+static int test_unit_printf(void) {
Manager *m;
Unit *u, *u2;
int r;
@@ -126,7 +126,7 @@ static void test_unit_printf(void) {
r = manager_new(SYSTEMD_USER, &m);
if (r == -EPERM) {
puts("manager_new: Permission denied. Skipping test.");
- return;
+ return EXIT_TEST_SKIP;
}
assert(r == 0);
@@ -189,11 +189,11 @@ static void test_unit_printf(void) {
expect(u2, "%b", bid);
expect(u2, "%H", host);
expect(u2, "%t", "/run/user/*");
+
+ return 0;
}
int main(int argc, char* argv[]) {
test_replacements();
- test_unit_printf();
-
- return 0;
+ return test_unit_printf();
}