diff options
author | Don <don.j.olmstead@gmail.com> | 2018-03-20 15:55:41 -0700 |
---|---|---|
committer | Don <don.j.olmstead@gmail.com> | 2018-03-20 16:44:41 -0700 |
commit | 644c1097a8402d170603f5a0ff17efb37360dac7 (patch) | |
tree | 473b3aae687b1aa1a30bd68559035162bc0600cc /tests/CMakeLists.txt | |
parent | 0263e69a9346e2a3c3bcbbed8f12a9749da63900 (diff) | |
download | portable-644c1097a8402d170603f5a0ff17efb37360dac7.tar.gz portable-644c1097a8402d170603f5a0ff17efb37360dac7.tar.bz2 portable-644c1097a8402d170603f5a0ff17efb37360dac7.zip |
Fix Windows tests within CMake
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4cc55d8..4942e0a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -24,6 +24,8 @@ foreach(lib IN LISTS OPENSSL_LIBS) | |||
24 | endif() | 24 | endif() |
25 | endforeach() | 25 | endforeach() |
26 | 26 | ||
27 | file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} TEST_SOURCE_DIR) | ||
28 | |||
27 | # aeadtest | 29 | # aeadtest |
28 | add_executable(aeadtest aeadtest.c) | 30 | add_executable(aeadtest aeadtest.c) |
29 | target_link_libraries(aeadtest ${TESTS_LIBS}) | 31 | target_link_libraries(aeadtest ${TESTS_LIBS}) |
@@ -242,9 +244,9 @@ if(ENABLE_EXTRATESTS) | |||
242 | add_executable(ocsp_test ocsp_test.c) | 244 | add_executable(ocsp_test ocsp_test.c) |
243 | target_link_libraries(ocsp_test ${TESTS_LIBS}) | 245 | target_link_libraries(ocsp_test ${TESTS_LIBS}) |
244 | if(NOT MSVC) | 246 | if(NOT MSVC) |
245 | add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) | 247 | add_test(NAME ocsptest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.sh) |
246 | else() | 248 | else() |
247 | add_test(ocsptest ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.bat) | 249 | add_test(NAME ocsptest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ocsptest.bat $<TARGET_FILE:ocsp_test>) |
248 | endif() | 250 | endif() |
249 | endif() | 251 | endif() |
250 | 252 | ||
@@ -281,11 +283,11 @@ add_test(poly1305test poly1305test) | |||
281 | add_executable(pq_test pq_test.c) | 283 | add_executable(pq_test pq_test.c) |
282 | target_link_libraries(pq_test ${TESTS_LIBS}) | 284 | target_link_libraries(pq_test ${TESTS_LIBS}) |
283 | if(NOT MSVC) | 285 | if(NOT MSVC) |
284 | add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) | 286 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) |
285 | else() | 287 | else() |
286 | add_test(pq_test ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat) | 288 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat $<TARGET_FILE:pq_test>) |
287 | endif() | 289 | endif() |
288 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 290 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
289 | 291 | ||
290 | # randtest | 292 | # randtest |
291 | add_executable(randtest randtest.c) | 293 | add_executable(randtest randtest.c) |
@@ -325,11 +327,11 @@ add_test(rsa_test rsa_test) | |||
325 | add_executable(servertest servertest.c) | 327 | add_executable(servertest servertest.c) |
326 | target_link_libraries(servertest ${TESTS_LIBS}) | 328 | target_link_libraries(servertest ${TESTS_LIBS}) |
327 | if(NOT MSVC) | 329 | if(NOT MSVC) |
328 | add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.sh) | 330 | add_test(NAME servertest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/servertest.sh) |
329 | else() | 331 | else() |
330 | add_test(servertest ${CMAKE_CURRENT_SOURCE_DIR}/servertest.bat) | 332 | add_test(NAME servertest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/servertest.bat $<TARGET_FILE:servertest>) |
331 | endif() | 333 | endif() |
332 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 334 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
333 | 335 | ||
334 | # sha1test | 336 | # sha1test |
335 | add_executable(sha1test sha1test.c) | 337 | add_executable(sha1test sha1test.c) |
@@ -355,35 +357,35 @@ add_test(ssl_versions ssl_versions) | |||
355 | add_executable(ssltest ssltest.c) | 357 | add_executable(ssltest ssltest.c) |
356 | target_link_libraries(ssltest ${TESTS_LIBS}) | 358 | target_link_libraries(ssltest ${TESTS_LIBS}) |
357 | if(NOT MSVC) | 359 | if(NOT MSVC) |
358 | add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) | 360 | add_test(NAME ssltest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.sh) |
359 | else() | 361 | else() |
360 | add_test(ssltest ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.bat) | 362 | add_test(NAME ssltest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ssltest.bat $<TARGET_FILE:ssltest> $<TARGET_FILE:openssl>) |
361 | endif() | 363 | endif() |
362 | set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 364 | set_tests_properties(ssltest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
363 | 365 | ||
364 | # testdsa | 366 | # testdsa |
365 | if(NOT MSVC) | 367 | if(NOT MSVC) |
366 | add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) | 368 | add_test(NAME testdsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.sh) |
367 | else() | 369 | else() |
368 | add_test(testdsa ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.bat) | 370 | add_test(NAME testdsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testdsa.bat $<TARGET_FILE:openssl>) |
369 | endif() | 371 | endif() |
370 | set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 372 | set_tests_properties(testdsa PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
371 | 373 | ||
372 | # testenc | 374 | # testenc |
373 | if(NOT MSVC) | 375 | if(NOT MSVC) |
374 | add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) | 376 | add_test(NAME testenc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testenc.sh) |
375 | else() | 377 | else() |
376 | add_test(testenc ${CMAKE_CURRENT_SOURCE_DIR}/testenc.bat) | 378 | add_test(NAME testenc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testenc.bat $<TARGET_FILE:openssl>) |
377 | endif() | 379 | endif() |
378 | set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 380 | set_tests_properties(testenc PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
379 | 381 | ||
380 | # testrsa | 382 | # testrsa |
381 | if(NOT MSVC) | 383 | if(NOT MSVC) |
382 | add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) | 384 | add_test(NAME testrsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.sh) |
383 | else() | 385 | else() |
384 | add_test(testrsa ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.bat) | 386 | add_test(NAME testrsa COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/testrsa.bat $<TARGET_FILE:openssl>) |
385 | endif() | 387 | endif() |
386 | set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 388 | set_tests_properties(testrsa PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
387 | 389 | ||
388 | # timingsafe | 390 | # timingsafe |
389 | add_executable(timingsafe timingsafe.c) | 391 | add_executable(timingsafe timingsafe.c) |
@@ -407,11 +409,11 @@ endif() | |||
407 | add_executable(tlstest ${TLSTEST_SRC}) | 409 | add_executable(tlstest ${TLSTEST_SRC}) |
408 | target_link_libraries(tlstest ${TESTS_LIBS}) | 410 | target_link_libraries(tlstest ${TESTS_LIBS}) |
409 | if(NOT MSVC) | 411 | if(NOT MSVC) |
410 | add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.sh) | 412 | add_test(NAME tlstest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.sh) |
411 | else() | 413 | else() |
412 | add_test(tlstest ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.bat) | 414 | add_test(NAME tlstest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tlstest.bat $<TARGET_FILE:tlstest>) |
413 | endif() | 415 | endif() |
414 | set_tests_properties(tlstest PROPERTIES ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}") | 416 | set_tests_properties(tlstest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
415 | 417 | ||
416 | # tls_ext_alpn | 418 | # tls_ext_alpn |
417 | add_executable(tls_ext_alpn tls_ext_alpn.c) | 419 | add_executable(tls_ext_alpn tls_ext_alpn.c) |