diff options
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d7cc499..55529cd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -1,3 +1,18 @@ | |||
1 | # | ||
2 | # Copyright (c) 2015 Brent Cook | ||
3 | # | ||
4 | # Permission to use, copy, modify, and distribute this software for any | ||
5 | # purpose with or without fee is hereby granted, provided that the above | ||
6 | # copyright notice and this permission notice appear in all copies. | ||
7 | # | ||
8 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | |||
1 | add_definitions(-DLIBRESSL_CRYPTO_INTERNAL) | 16 | add_definitions(-DLIBRESSL_CRYPTO_INTERNAL) |
2 | 17 | ||
3 | include_directories( | 18 | include_directories( |
@@ -65,6 +80,9 @@ function(add_platform_test TEST_NAME) | |||
65 | endif() | 80 | endif() |
66 | endfunction() | 81 | endfunction() |
67 | 82 | ||
83 | # XXX - should probably be in their own static lib | ||
84 | set(TEST_HELPER_SRC test.c test_util.c) | ||
85 | |||
68 | # aeadtest | 86 | # aeadtest |
69 | add_executable(aeadtest aeadtest.c) | 87 | add_executable(aeadtest aeadtest.c) |
70 | target_link_libraries(aeadtest ${OPENSSL_TEST_LIBS}) | 88 | target_link_libraries(aeadtest ${OPENSSL_TEST_LIBS}) |
@@ -449,6 +467,7 @@ add_platform_test(evptest evptest ${CMAKE_CURRENT_SOURCE_DIR}/evptests.txt) | |||
449 | # evp_test | 467 | # evp_test |
450 | add_executable(evp_test evp_test.c) | 468 | add_executable(evp_test evp_test.c) |
451 | target_link_libraries(evp_test ${OPENSSL_TEST_LIBS}) | 469 | target_link_libraries(evp_test ${OPENSSL_TEST_LIBS}) |
470 | prepare_emscripten_test_target(evp_test) | ||
452 | add_platform_test(evp_test evp_test) | 471 | add_platform_test(evp_test evp_test) |
453 | 472 | ||
454 | # exdata_test | 473 | # exdata_test |
@@ -536,19 +555,24 @@ prepare_emscripten_test_target(lhash_test) | |||
536 | add_platform_test(lhash_test lhash_test) | 555 | add_platform_test(lhash_test lhash_test) |
537 | 556 | ||
538 | # md_test | 557 | # md_test |
539 | add_executable(md_test md_test.c) | 558 | # XXX - ftruncate and mkstemp missing from Windows |
540 | target_link_libraries(md_test ${OPENSSL_TEST_LIBS}) | 559 | if(NOT WIN32) |
541 | add_platform_test(md_test md_test) | 560 | add_executable(md_test md_test.c ${TEST_HELPER_SRC}) |
561 | target_link_libraries(md_test ${OPENSSL_TEST_LIBS}) | ||
562 | add_platform_test(md_test md_test) | ||
563 | endif() | ||
542 | 564 | ||
543 | # mlkem_tests | 565 | # mlkem_tests |
544 | add_executable(mlkem_tests mlkem_tests.c mlkem_tests_util.c parse_test_file.c) | 566 | add_executable(mlkem_tests mlkem_tests.c parse_test_file.c) |
545 | target_link_libraries(mlkem_tests ${OPENSSL_TEST_LIBS}) | 567 | target_link_libraries(mlkem_tests ${OPENSSL_TEST_LIBS}) |
546 | prepare_emscripten_test_target(mlkem_tests) | 568 | prepare_emscripten_test_target(mlkem_tests) |
547 | if(NOT WIN32) | 569 | if(NOT MSVC) |
548 | add_test(NAME mlkem_tests COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mlkem_tests.sh) | 570 | add_test(NAME mlkem_tests COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mlkem_tests.sh) |
549 | set_tests_properties(mlkem_tests PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | 571 | set_tests_properties(mlkem_tests PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
572 | else() | ||
573 | add_test(NAME mlkem_tests COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mlkem_tests.bat $<TARGET_FILE:mlkem_tests>) | ||
550 | endif() | 574 | endif() |
551 | # XXX - add tests for Windows | 575 | set_tests_properties(mlkem_tests PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
552 | 576 | ||
553 | # mlkem_iteration_tests | 577 | # mlkem_iteration_tests |
554 | add_executable(mlkem_iteration_tests mlkem_iteration_tests.c mlkem_tests_util.c) | 578 | add_executable(mlkem_iteration_tests mlkem_iteration_tests.c mlkem_tests_util.c) |
@@ -620,13 +644,7 @@ add_platform_test(policy policy) | |||
620 | # pq_test | 644 | # pq_test |
621 | add_executable(pq_test pq_test.c) | 645 | add_executable(pq_test pq_test.c) |
622 | target_link_libraries(pq_test ${OPENSSL_TEST_LIBS}) | 646 | target_link_libraries(pq_test ${OPENSSL_TEST_LIBS}) |
623 | if(NOT WIN32) | 647 | add_platform_test(pq_test pq_test) |
624 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) | ||
625 | else() | ||
626 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat | ||
627 | $<TARGET_FILE:pq_test>) | ||
628 | endif() | ||
629 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | ||
630 | 648 | ||
631 | # quictest | 649 | # quictest |
632 | set(QUICTEST_SRC quictest.c) | 650 | set(QUICTEST_SRC quictest.c) |
@@ -724,9 +742,12 @@ endif() | |||
724 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | 742 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
725 | 743 | ||
726 | # sha_test | 744 | # sha_test |
727 | add_executable(sha_test sha_test.c) | 745 | # XXX - ftruncate and mkstemp missing from Windows |
728 | target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) | 746 | if(NOT WIN32) |
729 | add_platform_test(sha_test sha_test) | 747 | add_executable(sha_test sha_test.c ${TEST_HELPER_SRC}) |
748 | target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) | ||
749 | add_platform_test(sha_test sha_test) | ||
750 | endif() | ||
730 | 751 | ||
731 | # shutdowntest | 752 | # shutdowntest |
732 | set(SHUTDOWNTEST_SRC shutdowntest.c) | 753 | set(SHUTDOWNTEST_SRC shutdowntest.c) |
@@ -938,11 +959,6 @@ add_executable(x509_name_test x509_name_test.c) | |||
938 | target_link_libraries(x509_name_test ${OPENSSL_TEST_LIBS}) | 959 | target_link_libraries(x509_name_test ${OPENSSL_TEST_LIBS}) |
939 | add_platform_test(x509_name_test x509_name_test) | 960 | add_platform_test(x509_name_test x509_name_test) |
940 | 961 | ||
941 | # x509name | ||
942 | add_executable(x509name x509name.c) | ||
943 | target_link_libraries(x509name ${OPENSSL_TEST_LIBS}) | ||
944 | add_platform_test(x509name x509name) | ||
945 | |||
946 | # x509req_ext | 962 | # x509req_ext |
947 | add_executable(x509req_ext x509req_ext.c) | 963 | add_executable(x509req_ext x509req_ext.c) |
948 | target_link_libraries(x509req_ext ${OPENSSL_TEST_LIBS}) | 964 | target_link_libraries(x509req_ext ${OPENSSL_TEST_LIBS}) |