1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Only run SSL nsock tests if configured with OpenSSL

This commit is contained in:
dmiller
2015-02-11 04:55:36 +00:00
parent 2bf814b499
commit 7e30cb9c4a
2 changed files with 15 additions and 1 deletions

View File

@@ -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

View File

@@ -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