2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

conditionally test based on USE_LIBTOOL or LD_WRAP

This commit is contained in:
Mark Andrews
2019-11-14 10:00:36 +11:00
committed by Ondřej Surý
parent c7b20f3c40
commit 00605058b4
2 changed files with 12 additions and 0 deletions

View File

@@ -39,6 +39,7 @@
#include "nstest.h" #include "nstest.h"
#if defined(USE_LIBTOOL) || LD_WRAP
static int static int
_setup(void **state) { _setup(void **state) {
isc_result_t result; isc_result_t result;
@@ -139,15 +140,20 @@ notify_start(void **state) {
ns_test_cleanup_zone(); ns_test_cleanup_zone();
isc_nmhandle_unref(client->handle); isc_nmhandle_unref(client->handle);
} }
#endif
int int
main(void) { main(void) {
#if defined(USE_LIBTOOL) || LD_WRAP
const struct CMUnitTest tests[] = { const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(notify_start, cmocka_unit_test_setup_teardown(notify_start,
_setup, _teardown), _setup, _teardown),
}; };
return (cmocka_run_group_tests(tests, NULL, NULL)); return (cmocka_run_group_tests(tests, NULL, NULL));
#else
print_message("1..0 # Skip notify_test requires libtool or LD_WRAP\n");
#endif
} }
#else /* HAVE_CMOCKA && !__SANITIZE_ADDRESS__ */ #else /* HAVE_CMOCKA && !__SANITIZE_ADDRESS__ */

View File

@@ -35,6 +35,7 @@
#include "nstest.h" #include "nstest.h"
#if defined(USE_LIBTOOL) || LD_WRAP
static int static int
_setup(void **state) { _setup(void **state) {
isc_result_t result; isc_result_t result;
@@ -588,9 +589,11 @@ ns__query_start_test(void **state) {
run_start_test(&tests[i]); run_start_test(&tests[i]);
} }
} }
#endif
int int
main(void) { main(void) {
#if defined(USE_LIBTOOL) || LD_WRAP
const struct CMUnitTest tests[] = { const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(ns__query_sfcache_test, cmocka_unit_test_setup_teardown(ns__query_sfcache_test,
_setup, _teardown), _setup, _teardown),
@@ -599,6 +602,9 @@ main(void) {
}; };
return (cmocka_run_group_tests(tests, NULL, NULL)); return (cmocka_run_group_tests(tests, NULL, NULL));
#else
print_message("1..0 # Skip query_test requires libtool or LD_WRAP\n");
#endif
} }
#else /* HAVE_CMOCKA && !__SANITIZE_ADDRESS__ */ #else /* HAVE_CMOCKA && !__SANITIZE_ADDRESS__ */