Fixes for disabling the crypt test and benchmark. Added new "./configure --disable-crypttests" option. Also made sure use of both NO_CRYPT_BENCHMARK and NO_CRYPT_TEST in "./configure CFLAGS=-D" scenario work correctly.

This commit is contained in:
David Garske
2016-02-04 12:06:24 -08:00
parent bf1af39027
commit be4c400d16
6 changed files with 22 additions and 3 deletions

View File

@ -2236,6 +2236,14 @@ AS_IF([test "x$ENABLED_INLINE" = "xno"], [ENABLED_EXAMPLES="no"])
AS_IF([test "x$ENABLED_CRYPTONLY" = "xyes"], [ENABLED_EXAMPLES="no"])
AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$ENABLED_EXAMPLES" = "xyes"])
# Enable wolfCrypt test and benchmark
AC_ARG_ENABLE([crypttests],
[ --enable-crypttests Enable Crypt Bench/Test (default: enabled)],
[ ENABLED_CRYPT_TESTS=$enableval ],
[ ENABLED_CRYPT_TESTS=yes ]
)
AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS], [test "x$ENABLED_CRYPT_TESTS" = "xyes"])
# LIBZ
ENABLED_LIBZ="no"

View File

@ -110,10 +110,12 @@ int testsuite_test(int argc, char** argv)
server_args.signal = &ready;
InitTcpReady(&ready);
#ifndef NO_CRYPT_TEST
/* wc_ test */
wolfcrypt_test(&server_args);
if (server_args.return_code != 0) return server_args.return_code;
#endif
/* Simple wolfSSL client server test */
simple_test(&server_args);
if (server_args.return_code != 0) return server_args.return_code;

View File

@ -2016,5 +2016,7 @@ static INLINE word64 get_intel_cycles(void)
#endif /* HAVE_GET_CYCLES */
#else
int main() { return 0; }
#ifndef NO_MAIN_DRIVER
int main() { return 0; }
#endif
#endif /* !NO_CRYPT_BENCHMARK */

View File

@ -1,11 +1,13 @@
# vim:ft=automake
# All paths should be given relative to the root
if BUILD_WOLFCRYPT_TESTS
noinst_PROGRAMS += wolfcrypt/benchmark/benchmark
wolfcrypt_benchmark_benchmark_SOURCES = wolfcrypt/benchmark/benchmark.c
wolfcrypt_benchmark_benchmark_LDADD = src/libwolfssl.la $(LIB_STATIC_ADD)
wolfcrypt_benchmark_benchmark_DEPENDENCIES = src/libwolfssl.la
noinst_HEADERS += wolfcrypt/benchmark/benchmark.h
endif
EXTRA_DIST += wolfcrypt/benchmark/benchmark.sln
EXTRA_DIST += wolfcrypt/benchmark/benchmark.vcproj
DISTCLEANFILES+= wolfcrypt/benchmark/.libs/benchmark

View File

@ -1,6 +1,7 @@
# vim:ft=automake
# All paths should be given relative to the root
if BUILD_WOLFCRYPT_TESTS
noinst_PROGRAMS+= wolfcrypt/test/testwolfcrypt
if BUILD_CRYPTONLY
check_PROGRAMS+= wolfcrypt/test/testwolfcrypt
@ -10,6 +11,7 @@ wolfcrypt_test_testwolfcrypt_SOURCES = wolfcrypt/test/test.c
wolfcrypt_test_testwolfcrypt_LDADD = src/libwolfssl.la $(LIB_STATIC_ADD)
wolfcrypt_test_testwolfcrypt_DEPENDENCIES = src/libwolfssl.la
noinst_HEADERS += wolfcrypt/test/test.h
endif
EXTRA_DIST += wolfcrypt/test/test.sln
EXTRA_DIST += wolfcrypt/test/test.vcproj
DISTCLEANFILES+= wolfcrypt/test/.libs/testwolfcrypt

View File

@ -7568,5 +7568,8 @@ int pkcs7signed_test(void)
}
#endif /* HAVE_PKCS7 */
#else
#ifndef NO_MAIN_DRIVER
int main() { return 0; }
#endif
#endif /* NO_CRYPT_TEST */