diff options
author | kinichiro <kinichiro.inoguchi@gmail.com> | 2016-10-18 17:13:56 +0900 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2016-10-30 21:40:24 -0500 |
commit | 14905877a0eb85ebdc16162e820cda51f0895fc7 (patch) | |
tree | c8999f2188004e581e49480496139c7a5a9f7076 /tests/CMakeLists.txt | |
parent | b434123987dc08fd47bd988bd3fe09277445001d (diff) | |
download | portable-14905877a0eb85ebdc16162e820cda51f0895fc7.tar.gz portable-14905877a0eb85ebdc16162e820cda51f0895fc7.tar.bz2 portable-14905877a0eb85ebdc16162e820cda51f0895fc7.zip |
Enable tests on Visual Studio
- add patch for aeadtest.c to undef IN
- add patch for ocsp_test.c to call BIO_sock_init() before getaddrinfo()
- define STDERR_FILENO in unistd.h to build pkcs7test.c
- add option ENABLE_VSTEST(default OFF) to enable test on Visual Studio
- modify to pass test data file as an argument (aeadtest, evptest)
- add Windows scripts (ocsptest, pq_test, ssltest, testdsa, testenc, testrsa)
- do not build pidwraptest on MSVC
- fix some indentations
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 64 |
1 files changed, 43 insertions, 21 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 80a248e..7957235 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -14,8 +14,7 @@ add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/../apps/openss | |||
14 | # aeadtest | 14 | # aeadtest |
15 | add_executable(aeadtest aeadtest.c) | 15 | add_executable(aeadtest aeadtest.c) |
16 | target_link_libraries(aeadtest ${OPENSSL_LIBS}) | 16 | target_link_libraries(aeadtest ${OPENSSL_LIBS}) |
17 | add_test(aeadtest ${CMAKE_CURRENT_SOURCE_DIR}/aeadtest.sh) | 17 | add_test(aeadtest aeadtest ${CMAKE_CURRENT_SOURCE_DIR}/aeadtests.txt) |
18 | set_tests_properties(aeadtest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | ||
19 | 18 | ||
20 | # aes_wrap | 19 | # aes_wrap |
21 | add_executable(aes_wrap aes_wrap.c) | 20 | add_executable(aes_wrap aes_wrap.c) |
@@ -25,9 +24,9 @@ add_test(aes_wrap aes_wrap) | |||
25 | # arc4randomforktest | 24 | # arc4randomforktest |
26 | # Windows/mingw does not have fork, but Cygwin does. | 25 | # Windows/mingw does not have fork, but Cygwin does. |
27 | if(NOT CMAKE_HOST_WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES "MINGW") | 26 | if(NOT CMAKE_HOST_WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES "MINGW") |
28 | add_executable(arc4randomforktest arc4randomforktest.c) | 27 | add_executable(arc4randomforktest arc4randomforktest.c) |
29 | target_link_libraries(arc4randomforktest ${OPENSSL_LIBS}) | 28 | target_link_libraries(arc4randomforktest ${OPENSSL_LIBS}) |
30 | add_test(arc4randomforktest ${CMAKE_CURRENT_SOURCE_DIR}/arc4randomforktest.sh) | 29 | add_test(arc4randomforktest ${CMAKE_CURRENT_SOURCE_DIR}/arc4randomforktest.sh) |
31 | endif() | 30 | endif() |
32 | 31 | ||
33 | # asn1test | 32 | # asn1test |
@@ -136,19 +135,18 @@ add_test(enginetest enginetest) | |||
136 | # evptest | 135 | # evptest |
137 | add_executable(evptest evptest.c) | 136 | add_executable(evptest evptest.c) |
138 | target_link_libraries(evptest ${OPENSSL_LIBS}) | 137 | target_link_libraries(evptest ${OPENSSL_LIBS}) |
139 | add_test(evptest ${CMAKE_CURRENT_SOURCE_DIR}/evptest.sh) | 138 | add_test(evptest evptest ${CMAKE_CURRENT_SOURCE_DIR}/evptests.txt) |
140 | set_tests_properties(evptest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | ||
141 | 139 | ||
142 | # explicit_bzero | 140 | # explicit_bzero |
143 | # explicit_bzero relies on SA_ONSTACK, which is unavailable on Windows | 141 | # explicit_bzero relies on SA_ONSTACK, which is unavailable on Windows |
144 | if(NOT CMAKE_HOST_WIN32) | 142 | if(NOT CMAKE_HOST_WIN32) |
145 | if(HAVE_MEMMEM) | 143 | if(HAVE_MEMMEM) |
146 | add_executable(explicit_bzero explicit_bzero.c) | 144 | add_executable(explicit_bzero explicit_bzero.c) |
147 | else() | 145 | else() |
148 | add_executable(explicit_bzero explicit_bzero.c memmem.c) | 146 | add_executable(explicit_bzero explicit_bzero.c memmem.c) |
149 | endif() | 147 | endif() |
150 | target_link_libraries(explicit_bzero ${OPENSSL_LIBS}) | 148 | target_link_libraries(explicit_bzero ${OPENSSL_LIBS}) |
151 | add_test(explicit_bzero explicit_bzero) | 149 | add_test(explicit_bzero explicit_bzero) |
152 | endif() | 150 | endif() |
153 | 151 | ||
154 | # exptest | 152 | # exptest |
@@ -200,7 +198,11 @@ add_test(mont mont) | |||
200 | if(ENABLE_EXTRATESTS) | 198 | if(ENABLE_EXTRATESTS) |
201 | add_executable(ocsp_test ocsp_test.c) | 199 | add_executable(ocsp_test ocsp_test.c) |
202 | target_link_libraries(ocsp_test ${OPENSSL_LIBS}) | 200 | target_link_libraries(ocsp_test ${OPENSSL_LIBS}) |
203 | add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) | 201 | if(NOT MSVC) |
202 | add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) | ||
203 | else() | ||
204 | add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.bat) | ||
205 | endif() | ||
204 | endif() | 206 | endif() |
205 | 207 | ||
206 | # optionstest | 208 | # optionstest |
@@ -216,7 +218,7 @@ add_test(pbkdf2 pbkdf2) | |||
216 | # pidwraptest | 218 | # pidwraptest |
217 | # pidwraptest relies on an OS-specific way to give out pids and is generally | 219 | # pidwraptest relies on an OS-specific way to give out pids and is generally |
218 | # awkward on systems with slow fork | 220 | # awkward on systems with slow fork |
219 | if(ENABLE_EXTRATESTS) | 221 | if(ENABLE_EXTRATESTS AND NOT MSVC) |
220 | add_executable(pidwraptest pidwraptest.c) | 222 | add_executable(pidwraptest pidwraptest.c) |
221 | target_link_libraries(pidwraptest ${OPENSSL_LIBS}) | 223 | target_link_libraries(pidwraptest ${OPENSSL_LIBS}) |
222 | add_test(pidwraptest ${CMAKE_CURRENT_SOURCE_DIR}/pidwraptest.sh) | 224 | add_test(pidwraptest ${CMAKE_CURRENT_SOURCE_DIR}/pidwraptest.sh) |
@@ -235,7 +237,11 @@ add_test(poly1305test poly1305test) | |||
235 | # pq_test | 237 | # pq_test |
236 | add_executable(pq_test pq_test.c) | 238 | add_executable(pq_test pq_test.c) |
237 | target_link_libraries(pq_test ${OPENSSL_LIBS}) | 239 | target_link_libraries(pq_test ${OPENSSL_LIBS}) |
238 | add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) | 240 | if(NOT MSVC) |
241 | add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) | ||
242 | else() | ||
243 | add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat) | ||
244 | endif() | ||
239 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 245 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") |
240 | 246 | ||
241 | # randtest | 247 | # randtest |
@@ -285,19 +291,35 @@ add_test(sha512test sha512test) | |||
285 | # ssltest | 291 | # ssltest |
286 | add_executable(ssltest ssltest.c) | 292 | add_executable(ssltest ssltest.c) |
287 | target_link_libraries(ssltest ${OPENSSL_LIBS}) | 293 | target_link_libraries(ssltest ${OPENSSL_LIBS}) |
288 | add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) | 294 | if(NOT MSVC) |
295 | add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) | ||
296 | else() | ||
297 | add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.bat) | ||
298 | endif() | ||
289 | set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 299 | set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") |
290 | 300 | ||
291 | # testdsa | 301 | # testdsa |
292 | add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) | 302 | if(NOT MSVC) |
303 | add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) | ||
304 | else() | ||
305 | add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.bat) | ||
306 | endif() | ||
293 | set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 307 | set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") |
294 | 308 | ||
295 | # testenc | 309 | # testenc |
296 | add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) | 310 | if(NOT MSVC) |
311 | add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) | ||
312 | else() | ||
313 | add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.bat) | ||
314 | endif() | ||
297 | set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 315 | set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") |
298 | 316 | ||
299 | # testrsa | 317 | # testrsa |
300 | add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) | 318 | if(NOT MSVC) |
319 | add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) | ||
320 | else() | ||
321 | add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.bat) | ||
322 | endif() | ||
301 | set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 323 | set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") |
302 | 324 | ||
303 | # timingsafe | 325 | # timingsafe |