tests: add helper to unify skipping a test and exiting

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-09-14 09:29:57 +02:00
parent c1cd674357
commit 317bb217d3
34 changed files with 128 additions and 178 deletions
+7
View File
@@ -9,6 +9,7 @@
#include "alloc-util.h"
#include "env-util.h"
#include "fileio.h"
#include "log.h"
#include "path-util.h"
#include "strv.h"
#include "tests.h"
@@ -89,3 +90,9 @@ bool slow_tests_enabled(void) {
log_warning_errno(r, "Cannot parse $SYSTEMD_SLOW_TESTS, ignoring.");
return SYSTEMD_SLOW_TESTS_DEFAULT;
}
int log_tests_skipped(const char *message) {
log_notice("%s: %s, skipping tests.",
program_invocation_short_name, message);
return EXIT_TEST_SKIP;
}
+1
View File
@@ -5,3 +5,4 @@ char* setup_fake_runtime_dir(void);
const char* get_testdata_dir(void);
const char* get_catalog_dir(void);
bool slow_tests_enabled(void);
int log_tests_skipped(const char *message);