diff options
author | Brent Cook <busterb@gmail.com> | 2017-01-13 09:10:59 -0600 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2017-01-15 14:52:18 -0600 |
commit | fa20dae3297fd547341021c7bda9b7a567f6a881 (patch) | |
tree | d0fea413f07027cd55927489a7e82da401b0286a /tests | |
parent | 1d934cd2d85872728c8e17a4f5afed5582980eb3 (diff) | |
download | portable-fa20dae3297fd547341021c7bda9b7a567f6a881.tar.gz portable-fa20dae3297fd547341021c7bda9b7a567f6a881.tar.bz2 portable-fa20dae3297fd547341021c7bda9b7a567f6a881.zip |
start to enable tlstest for portable
Disabled on Windows for now due to pipe2/socketpair support.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 17 | ||||
-rw-r--r-- | tests/Makefile.am | 8 | ||||
-rw-r--r-- | tests/tlstest.bat | 14 | ||||
-rwxr-xr-x | tests/tlstest.sh | 13 |
4 files changed, 51 insertions, 1 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1016d32..f4277bd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -12,7 +12,9 @@ include_directories( | |||
12 | add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/../apps/openssl/cert.pem\") | 12 | add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/../apps/openssl/cert.pem\") |
13 | 13 | ||
14 | foreach(lib IN LISTS OPENSSL_LIBS) | 14 | foreach(lib IN LISTS OPENSSL_LIBS) |
15 | if(${lib} STREQUAL "ssl-shared") | 15 | if(${lib} STREQUAL "tls-shared") |
16 | set(TESTS_LIBS ${TESTS_LIBS} tls) | ||
17 | elseif(${lib} STREQUAL "ssl-shared") | ||
16 | set(TESTS_LIBS ${TESTS_LIBS} ssl) | 18 | set(TESTS_LIBS ${TESTS_LIBS} ssl) |
17 | elseif(${lib} STREQUAL "crypto-shared") | 19 | elseif(${lib} STREQUAL "crypto-shared") |
18 | set(TESTS_LIBS ${TESTS_LIBS} crypto) | 20 | set(TESTS_LIBS ${TESTS_LIBS} crypto) |
@@ -342,6 +344,18 @@ add_executable(timingsafe timingsafe.c) | |||
342 | target_link_libraries(timingsafe ${TESTS_LIBS}) | 344 | target_link_libraries(timingsafe ${TESTS_LIBS}) |
343 | add_test(timingsafe timingsafe) | 345 | add_test(timingsafe timingsafe) |
344 | 346 | ||
347 | # tlstest | ||
348 | if(NOT CMAKE_HOST_WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES "MINGW") | ||
349 | add_executable(tlstest tlstest.c) | ||
350 | target_link_libraries(tlstest ${TESTS_LIBS}) | ||
351 | if(NOT MSVC) | ||
352 | add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.sh) | ||
353 | else() | ||
354 | add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.bat) | ||
355 | endif() | ||
356 | set_tests_properties(tlstest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | ||
357 | endif() | ||
358 | |||
345 | # tls_ext_alpn | 359 | # tls_ext_alpn |
346 | add_executable(tls_ext_alpn tls_ext_alpn.c) | 360 | add_executable(tls_ext_alpn tls_ext_alpn.c) |
347 | target_link_libraries(tls_ext_alpn ${TESTS_LIBS}) | 361 | target_link_libraries(tls_ext_alpn ${TESTS_LIBS}) |
@@ -365,6 +379,7 @@ add_test(x25519test x25519test) | |||
365 | if(ENABLE_VSTEST AND USE_SHARED) | 379 | if(ENABLE_VSTEST AND USE_SHARED) |
366 | add_custom_command(TARGET x25519test POST_BUILD | 380 | add_custom_command(TARGET x25519test POST_BUILD |
367 | COMMAND "${CMAKE_COMMAND}" -E copy | 381 | COMMAND "${CMAKE_COMMAND}" -E copy |
382 | "$<TARGET_FILE:tls-shared>" | ||
368 | "$<TARGET_FILE:ssl-shared>" | 383 | "$<TARGET_FILE:ssl-shared>" |
369 | "$<TARGET_FILE:crypto-shared>" | 384 | "$<TARGET_FILE:crypto-shared>" |
370 | "${CMAKE_CURRENT_BINARY_DIR}" | 385 | "${CMAKE_CURRENT_BINARY_DIR}" |
diff --git a/tests/Makefile.am b/tests/Makefile.am index 7725796..ab1f2f1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -332,6 +332,14 @@ TESTS += timingsafe | |||
332 | check_PROGRAMS += timingsafe | 332 | check_PROGRAMS += timingsafe |
333 | timingsafe_SOURCES = timingsafe.c | 333 | timingsafe_SOURCES = timingsafe.c |
334 | 334 | ||
335 | # tlstest | ||
336 | if !HOST_WIN | ||
337 | TESTS += tlstest.sh | ||
338 | check_PROGRAMS += tlstest | ||
339 | tlstest_SOURCES = tlstest.c | ||
340 | EXTRA_DIST += tlstest.sh tlstest.bat | ||
341 | endif | ||
342 | |||
335 | # tls_ext_alpn | 343 | # tls_ext_alpn |
336 | TESTS += tls_ext_alpn | 344 | TESTS += tls_ext_alpn |
337 | check_PROGRAMS += tls_ext_alpn | 345 | check_PROGRAMS += tls_ext_alpn |
diff --git a/tests/tlstest.bat b/tests/tlstest.bat new file mode 100644 index 0000000..7c5edd6 --- /dev/null +++ b/tests/tlstest.bat | |||
@@ -0,0 +1,14 @@ | |||
1 | @echo off | ||
2 | setlocal enabledelayedexpansion | ||
3 | REM tlstest.bat | ||
4 | |||
5 | set tlstest_bin=Debug\tlstest.exe | ||
6 | if not exist %tlstest_bin% exit /b 1 | ||
7 | |||
8 | if "%srcdir%"=="" ( | ||
9 | set srcdir=. | ||
10 | ) | ||
11 | |||
12 | %tlstest_bin% %srcdir%\server.pem %srcdir%\server.pem %srcdir%\ca.pem | ||
13 | |||
14 | endlocal | ||
diff --git a/tests/tlstest.sh b/tests/tlstest.sh new file mode 100755 index 0000000..a45a3e9 --- /dev/null +++ b/tests/tlstest.sh | |||
@@ -0,0 +1,13 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | tlstest_bin=./tlstest | ||
5 | if [ -e ./tlstest.exe ]; then | ||
6 | tlstest_bin=./tlstest.exe | ||
7 | fi | ||
8 | |||
9 | if [ -z $srcdir ]; then | ||
10 | srcdir=. | ||
11 | fi | ||
12 | |||
13 | $tlstest_bin $srcdir/server.pem $srcdir/server.pem $srcdir/ca.pem | ||