From: Michał Kępień Date: Thu, 12 Sep 2019 12:25:57 +0000 (+0200) Subject: Tweak lib/dns/tests/tkey_test requirements X-Git-Tag: v9.15.5~33^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=154f2ca6f6b3c01679e4cdb61ab70ff4eb050fba;p=thirdparty%2Fbind9.git Tweak lib/dns/tests/tkey_test requirements Currently, the lib/dns/tests/tkey_test unit test is only run when the linker supports the --wrap option. However, linker support for that option is only needed for static builds. As a result, the unit test mentioned before is not being run everywhere it can be run as even for builds done using --with-libtool, the test is not run unless the linker supports the --wrap option. Tweak preprocessor directives in lib/dns/tests/tkey_test.c so that this test is run: - for all builds using --with-libtool, - for static builds done using a linker supporting the --wrap option. --- diff --git a/lib/dns/tests/tkey_test.c b/lib/dns/tests/tkey_test.c index 5b91aa0a02e..f89611206e9 100644 --- a/lib/dns/tests/tkey_test.c +++ b/lib/dns/tests/tkey_test.c @@ -27,7 +27,7 @@ #include -#if LD_WRAP +#if defined(USE_LIBTOOL) || LD_WRAP static isc_mem_t mock_mctx = { .impmagic = 0, .magic = ISCAPI_MCTX_MAGIC, @@ -167,11 +167,11 @@ dns_tkeyctx_destroy_test(void **state) { assert_non_null(tctx); dns_tkeyctx_destroy(&tctx); } -#endif /* LD_WRAP */ +#endif /* defined(USE_LIBTOOL) || LD_WRAP */ int main(void) { -#if LD_WRAP +#if defined(USE_LIBTOOL) || LD_WRAP const struct CMUnitTest tkey_tests[] = { cmocka_unit_test_teardown(dns_tkeyctx_create_test, _teardown), cmocka_unit_test_setup(dns_tkeyctx_destroy_test, _setup), @@ -187,9 +187,9 @@ main(void) { #endif }; return (cmocka_run_group_tests(tkey_tests, NULL, NULL)); -#else /* LD_WRAP */ - print_message("1..0 # Skip tkey_test requires LD_WRAP\n"); -#endif /* LD_WRAP */ +#else /* defined(USE_LIBTOOL) || LD_WRAP */ + print_message("1..0 # Skip tkey_test requires libtool or LD_WRAP\n"); +#endif /* defined(USE_LIBTOOL) || LD_WRAP */ } #else /* CMOCKA */