diff --git a/nsock/tests/run_tests.sh b/nsock/tests/run_tests.sh index f2b45f68d..d8c468dec 100755 --- a/nsock/tests/run_tests.sh +++ b/nsock/tests/run_tests.sh @@ -76,7 +76,7 @@ cleanup_all() { main() { setup_echo_udp $PORT_UDP setup_echo_tcp $PORT_TCP - setup_echo_tcpssl $PORT_TCPSSL + $EXEC_MAIN --ssl && setup_echo_tcpssl $PORT_TCPSSL $TRACER $EXEC_MAIN diff --git a/nsock/tests/tests_main.c b/nsock/tests/tests_main.c index 29b963747..bfa6b93d9 100644 --- a/nsock/tests/tests_main.c +++ b/nsock/tests/tests_main.c @@ -5,6 +5,7 @@ #include "test-common.h" +#include "string.h" #ifndef WIN32 @@ -36,7 +37,9 @@ extern const struct test_case TestGHHeaps; extern const struct test_case TestHeapOrdering; extern const struct test_case TestCancelTCP; extern const struct test_case TestCancelUDP; +#ifdef HAVE_OPENSSL extern const struct test_case TestCancelSSL; +#endif static const struct test_case *TestCases[] = { @@ -58,7 +61,9 @@ static const struct test_case *TestCases[] = { /* ---- cancel.c */ &TestCancelTCP, &TestCancelUDP, +#ifdef HAVE_OPENSSL &TestCancelSSL, +#endif NULL }; @@ -94,6 +99,15 @@ static int win_init(void) { int main(int ac, char **av) { int rc, i; + /* simple "do we have ssl" check for run_tests.sh */ + if (ac == 2 && !strncmp(av[1], "--ssl", 5)) { +#ifdef HAVE_SSL + return 0; +#else + return 1; +#endif + } + #ifdef WIN32 win_init(); #endif