From: Nikos Mavrogiannopoulos Date: Tue, 6 Sep 2016 14:45:19 +0000 (+0200) Subject: tests: don't build cmocka tests with libutils - they conflict X-Git-Tag: gnutls_3_5_4~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de57170807467877b8e128f1ccf94bd62cfbca2e;p=thirdparty%2Fgnutls.git tests: don't build cmocka tests with libutils - they conflict --- diff --git a/tests/Makefile.am b/tests/Makefile.am index daf9d017bf..794cc642b5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -48,10 +48,12 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/doc/examples AM_LDFLAGS = -no-install -LDADD = ../lib/libgnutls.la \ - libutils.la \ +COMMON_LDADD = ../lib/libgnutls.la \ $(LIBSOCKET) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSECCOMP) +LDADD = $(COMMON_LDADD) \ + libutils.la + dane_LDADD = $(LDADD) ../libdane/libgnutls-dane.la if ENABLE_MINITASN1 @@ -116,8 +118,14 @@ ctests += dtls-with-seccomp tls-with-seccomp dtls-client-with-seccomp tls-client endif if HAVE_CMOCKA -LDADD += $(CMOCKA_LIBS) +CMOCKA_LDADD = $(COMMON_LDADD) $(CMOCKA_LIBS) ctests += dtls-sliding-window ip-utils name-constraints-ip conv-utf8 + +dtls_sliding_window_LDADD = $(CMOCKA_LDADD) +ip_utils_LDADD = $(CMOCKA_LDADD) +name_constraints_ip_LDADD = $(CMOCKA_LDADD) +conv_utf8_LDADD = $(CMOCKA_LDADD) + endif mini_dtls_pthread_LDADD = $(LDADD) -lpthread diff --git a/tests/name-constraints-ip.c b/tests/name-constraints-ip.c index bb5903ac94..626c64d5c9 100644 --- a/tests/name-constraints-ip.c +++ b/tests/name-constraints-ip.c @@ -39,9 +39,6 @@ #include #include "../lib/x509/ip.h" -extern int debug; -void doit(void); - typedef struct test_vars_t { gnutls_x509_name_constraints_t nc; gnutls_x509_name_constraints_t nc2; @@ -134,8 +131,7 @@ static void check_generation_reading_basic_checking(void **glob_state) char ip_out[60]; gnutls_global_set_log_function(tls_log_func); - if (debug) - gnutls_global_set_log_level(6000); + gnutls_global_set_log_level(2); /* 1: test the generation of name constraints */ @@ -189,10 +185,10 @@ static void check_generation_reading_basic_checking(void **glob_state) i = 0; do { ret = gnutls_x509_name_constraints_get_permitted(nc, i++, &type, &name); - if (debug) { +#ifdef DEBUG _gnutls_cidr_to_string(name.data, name.size, ip_out, sizeof(ip_out)); printf("Loaded name constraint: %s\n",ip_out); - } +#endif } while(ret == 0); if (i-1 != num_permitted) { @@ -202,10 +198,10 @@ static void check_generation_reading_basic_checking(void **glob_state) i = 0; do { ret = gnutls_x509_name_constraints_get_excluded(nc, i++, &type, &name); - if (debug) { +#ifdef DEBUG _gnutls_cidr_to_string(name.data, name.size, ip_out, sizeof(ip_out)); printf("Loaded name constraint: %s\n",ip_out); - } +#endif } while(ret == 0); if (i-1 != num_excluded) { @@ -708,7 +704,7 @@ static int teardown(void **state) { return 0; } -void doit(void) +int main() { const struct CMUnitTest tests[] = { cmocka_unit_test_setup_teardown(check_generation_reading_basic_checking, setup, teardown),