diff options
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8d6fa9d..c497b77 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( |
@@ -28,10 +43,12 @@ elseif(HOST_ARM) | |||
28 | include_directories(../crypto/arch/arm/) | 43 | include_directories(../crypto/arch/arm/) |
29 | elseif(HOST_I386) | 44 | elseif(HOST_I386) |
30 | include_directories(../crypto/arch/i386/) | 45 | include_directories(../crypto/arch/i386/) |
46 | elseif(HOST_LOONGARCH64) | ||
47 | include_directories(../crypto/arch/loongarch64) | ||
31 | elseif(HOST_MIPS64) | 48 | elseif(HOST_MIPS64) |
32 | include_directories(../crypto/arch/mips64) | 49 | include_directories(../crypto/arch/mips64) |
33 | elseif(HOST_MIPS) | 50 | elseif(HOST_MIPS) |
34 | # XXX - can this go away? the directory doesn't exist... | 51 | include_directories(../crypto/arch/mips) |
35 | elseif(HOST_POWERPC) | 52 | elseif(HOST_POWERPC) |
36 | include_directories(../crypto/arch/powerpc) | 53 | include_directories(../crypto/arch/powerpc) |
37 | elseif(HOST_POWERPC64) | 54 | elseif(HOST_POWERPC64) |
@@ -63,6 +80,9 @@ function(add_platform_test TEST_NAME) | |||
63 | endif() | 80 | endif() |
64 | endfunction() | 81 | endfunction() |
65 | 82 | ||
83 | # XXX - should probably be in their own static lib | ||
84 | set(TEST_HELPER_SRC test.c test_util.c) | ||
85 | |||
66 | # aeadtest | 86 | # aeadtest |
67 | add_executable(aeadtest aeadtest.c) | 87 | add_executable(aeadtest aeadtest.c) |
68 | target_link_libraries(aeadtest ${OPENSSL_TEST_LIBS}) | 88 | target_link_libraries(aeadtest ${OPENSSL_TEST_LIBS}) |
@@ -447,6 +467,7 @@ add_platform_test(evptest evptest ${CMAKE_CURRENT_SOURCE_DIR}/evptests.txt) | |||
447 | # evp_test | 467 | # evp_test |
448 | add_executable(evp_test evp_test.c) | 468 | add_executable(evp_test evp_test.c) |
449 | target_link_libraries(evp_test ${OPENSSL_TEST_LIBS}) | 469 | target_link_libraries(evp_test ${OPENSSL_TEST_LIBS}) |
470 | prepare_emscripten_test_target(evp_test) | ||
450 | add_platform_test(evp_test evp_test) | 471 | add_platform_test(evp_test evp_test) |
451 | 472 | ||
452 | # exdata_test | 473 | # exdata_test |
@@ -534,9 +555,12 @@ prepare_emscripten_test_target(lhash_test) | |||
534 | add_platform_test(lhash_test lhash_test) | 555 | add_platform_test(lhash_test lhash_test) |
535 | 556 | ||
536 | # md_test | 557 | # md_test |
537 | add_executable(md_test md_test.c) | 558 | # XXX - ftruncate and mkstemp missing from Windows |
538 | target_link_libraries(md_test ${OPENSSL_TEST_LIBS}) | 559 | if(NOT WIN32) |
539 | 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() | ||
540 | 564 | ||
541 | # mlkem_tests | 565 | # mlkem_tests |
542 | add_executable(mlkem_tests mlkem_tests.c mlkem_tests_util.c parse_test_file.c) | 566 | add_executable(mlkem_tests mlkem_tests.c mlkem_tests_util.c parse_test_file.c) |
@@ -618,13 +642,7 @@ add_platform_test(policy policy) | |||
618 | # pq_test | 642 | # pq_test |
619 | add_executable(pq_test pq_test.c) | 643 | add_executable(pq_test pq_test.c) |
620 | target_link_libraries(pq_test ${OPENSSL_TEST_LIBS}) | 644 | target_link_libraries(pq_test ${OPENSSL_TEST_LIBS}) |
621 | if(NOT WIN32) | 645 | add_platform_test(pq_test pq_test) |
622 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) | ||
623 | else() | ||
624 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat | ||
625 | $<TARGET_FILE:pq_test>) | ||
626 | endif() | ||
627 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | ||
628 | 646 | ||
629 | # quictest | 647 | # quictest |
630 | set(QUICTEST_SRC quictest.c) | 648 | set(QUICTEST_SRC quictest.c) |
@@ -722,9 +740,12 @@ endif() | |||
722 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | 740 | set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") |
723 | 741 | ||
724 | # sha_test | 742 | # sha_test |
725 | add_executable(sha_test sha_test.c) | 743 | # XXX - ftruncate and mkstemp missing from Windows |
726 | target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) | 744 | if(NOT WIN32) |
727 | add_platform_test(sha_test sha_test) | 745 | add_executable(sha_test sha_test.c ${TEST_HELPER_SRC}) |
746 | target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) | ||
747 | add_platform_test(sha_test sha_test) | ||
748 | endif() | ||
728 | 749 | ||
729 | # shutdowntest | 750 | # shutdowntest |
730 | set(SHUTDOWNTEST_SRC shutdowntest.c) | 751 | set(SHUTDOWNTEST_SRC shutdowntest.c) |
@@ -936,11 +957,6 @@ add_executable(x509_name_test x509_name_test.c) | |||
936 | target_link_libraries(x509_name_test ${OPENSSL_TEST_LIBS}) | 957 | target_link_libraries(x509_name_test ${OPENSSL_TEST_LIBS}) |
937 | add_platform_test(x509_name_test x509_name_test) | 958 | add_platform_test(x509_name_test x509_name_test) |
938 | 959 | ||
939 | # x509name | ||
940 | add_executable(x509name x509name.c) | ||
941 | target_link_libraries(x509name ${OPENSSL_TEST_LIBS}) | ||
942 | add_platform_test(x509name x509name) | ||
943 | |||
944 | # x509req_ext | 960 | # x509req_ext |
945 | add_executable(x509req_ext x509req_ext.c) | 961 | add_executable(x509req_ext x509req_ext.c) |
946 | target_link_libraries(x509req_ext ${OPENSSL_TEST_LIBS}) | 962 | target_link_libraries(x509req_ext ${OPENSSL_TEST_LIBS}) |