Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/CMakeLists.txt
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
# Generate the config | # Generate the config | ||||
configure_file(src/libsecp256k1-config.h.cmake.in src/libsecp256k1-config.h ESCAPE_QUOTES) | configure_file(src/libsecp256k1-config.h.cmake.in src/libsecp256k1-config.h ESCAPE_QUOTES) | ||||
target_compile_definitions(secp256k1 PRIVATE HAVE_CONFIG_H) | target_compile_definitions(secp256k1 PRIVATE HAVE_CONFIG_H) | ||||
# Tests | # Tests | ||||
option(SECP256K1_BUILD_TEST "Build secp256k1's unit tests" ON) | option(SECP256K1_BUILD_TEST "Build secp256k1's unit tests" ON) | ||||
if(SECP256K1_BUILD_TEST) | if(SECP256K1_BUILD_TEST) | ||||
enable_testing() | include(TestSuite) | ||||
create_test_suite(secp256k1) | |||||
function(create_secp256k1_test NAME FILES) | function(create_secp256k1_test NAME FILES) | ||||
add_executable(${NAME} ${FILES}) | add_test_to_suite(secp256k1 ${NAME} EXCLUDE_FROM_ALL ${FILES}) | ||||
target_link_libraries(${NAME} secp256k1) | target_link_libraries(${NAME} secp256k1) | ||||
add_test(NAME ${NAME} COMMAND ${NAME}) | |||||
target_compile_definitions(${NAME} PRIVATE HAVE_CONFIG_H) | target_compile_definitions(${NAME} PRIVATE HAVE_CONFIG_H) | ||||
endfunction() | endfunction() | ||||
create_secp256k1_test(secp256k1_tests src/tests.c) | create_secp256k1_test(secp256k1_tests src/tests.c) | ||||
target_compile_definitions(secp256k1_tests PRIVATE VERIFY) | target_compile_definitions(secp256k1_tests PRIVATE VERIFY) | ||||
create_secp256k1_test(exhaustive_tests src/tests_exhaustive.c) | create_secp256k1_test(exhaustive_tests src/tests_exhaustive.c) | ||||
# This should not be enabled at the same time as coverage is. | # This should not be enabled at the same time as coverage is. | ||||
# TODO: support coverage. | # TODO: support coverage. | ||||
target_compile_definitions(exhaustive_tests PRIVATE VERIFY) | target_compile_definitions(exhaustive_tests PRIVATE VERIFY) | ||||
endif(SECP256K1_BUILD_TEST) | endif(SECP256K1_BUILD_TEST) | ||||
# TODO: emult static precomputation | # TODO: emult static precomputation | ||||
# TODO: ecdh module | # TODO: ecdh module | ||||
# TODO: RECOVERY module | # TODO: RECOVERY module |