diff --git a/configure.ac b/configure.ac index 517c7deaa..c93569ed6 100644 --- a/configure.ac +++ b/configure.ac @@ -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" diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c index 792cbbbde..cb063d75c 100644 --- a/testsuite/testsuite.c +++ b/testsuite/testsuite.c @@ -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; diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index d9b0c36fb..83bdbf105 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -2015,4 +2015,8 @@ static INLINE word64 get_intel_cycles(void) } #endif /* HAVE_GET_CYCLES */ +#else + #ifndef NO_MAIN_DRIVER + int main() { return 0; } + #endif #endif /* !NO_CRYPT_BENCHMARK */ diff --git a/wolfcrypt/benchmark/include.am b/wolfcrypt/benchmark/include.am index f147883da..3911c7323 100644 --- a/wolfcrypt/benchmark/include.am +++ b/wolfcrypt/benchmark/include.am @@ -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 diff --git a/wolfcrypt/test/include.am b/wolfcrypt/test/include.am index 18805a3e2..ff9d59a00 100644 --- a/wolfcrypt/test/include.am +++ b/wolfcrypt/test/include.am @@ -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 diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 5f6cc98a9..ee11c6ccb 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -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 */