tests: add helper to unify skipping a test and exiting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user