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
+3 -4
View File
@@ -9,6 +9,7 @@
#include "sd-event.h"
#include "dhcp-server-internal.h"
#include "tests.h"
static void test_pool(struct in_addr *address, unsigned size, int ret) {
_cleanup_(sd_dhcp_server_unrefp) sd_dhcp_server *server = NULL;
@@ -235,10 +236,8 @@ int main(int argc, char *argv[]) {
assert_se(sd_event_new(&e) >= 0);
r = test_basic(e);
if (r != 0) {
log_notice("%s: skipping tests.", program_invocation_short_name);
return EXIT_TEST_SKIP;
}
if (r != 0)
return log_tests_skipped("cannot start dhcp server");
test_message_handler();
test_client_id_hash();