]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
conditionally test based on USE_LIBTOOL or LD_WRAP
authorMark Andrews <marka@isc.org>
Wed, 13 Nov 2019 23:00:36 +0000 (10:00 +1100)
committerOndřej Surý <ondrej@sury.org>
Sat, 16 Nov 2019 03:46:06 +0000 (11:46 +0800)
lib/ns/tests/notify_test.c
lib/ns/tests/query_test.c

index bc94fcc01b71c4aa6c240e2e57faedc81f684960..926bf246a0aebee1e3647aff131597cefd020ecf 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "nstest.h"
 
+#if defined(USE_LIBTOOL) || LD_WRAP
 static int
 _setup(void **state) {
        isc_result_t result;
@@ -139,15 +140,20 @@ notify_start(void **state) {
        ns_test_cleanup_zone();
        isc_nmhandle_unref(client->handle);
 }
+#endif
 
 int
 main(void) {
+#if defined(USE_LIBTOOL) || LD_WRAP
        const struct CMUnitTest tests[] = {
                cmocka_unit_test_setup_teardown(notify_start,
                                                _setup, _teardown),
        };
 
        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__ */
 
index 3094ced2b8aa3d9322c2422422e0cb6c73bcff30..d0b5bbf9058b0fe2d1d5d8738baa8de1904c5674 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "nstest.h"
 
+#if defined(USE_LIBTOOL) || LD_WRAP
 static int
 _setup(void **state) {
        isc_result_t result;
@@ -588,9 +589,11 @@ ns__query_start_test(void **state) {
                run_start_test(&tests[i]);
        }
 }
+#endif
 
 int
 main(void) {
+#if defined(USE_LIBTOOL) || LD_WRAP
        const struct CMUnitTest tests[] = {
                cmocka_unit_test_setup_teardown(ns__query_sfcache_test,
                                                _setup, _teardown),
@@ -599,6 +602,9 @@ main(void) {
        };
 
        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__ */