File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed
Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,8 @@ endif()
134134
135135option (SECP256K1_BUILD_BENCHMARK "Build benchmarks." ON )
136136option (SECP256K1_BUILD_TESTS "Build tests." ON )
137+ option (SECP256K1_BUILD_VERIFY_TESTS "Build tests with -DVERIFY." ${SECP256K1_BUILD_TESTS} )
138+ mark_as_advanced (SECP256K1_BUILD_VERIFY_TESTS)
137139option (SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." ON )
138140option (SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND} )
139141option (SECP256K1_BUILD_EXAMPLES "Build examples." OFF )
@@ -258,11 +260,7 @@ endif()
258260message ("Optional binaries:" )
259261message (" benchmark ........................... ${SECP256K1_BUILD_BENCHMARK} " )
260262message (" noverify_tests ...................... ${SECP256K1_BUILD_TESTS} " )
261- set (tests_status "${SECP256K1_BUILD_TESTS} " )
262- if (CMAKE_BUILD_TYPE STREQUAL "Coverage" )
263- set (tests_status OFF )
264- endif ()
265- message (" tests ............................... ${tests_status} " )
263+ message (" tests ............................... ${SECP256K1_BUILD_VERIFY_TESTS} " )
266264message (" exhaustive tests .................... ${SECP256K1_BUILD_EXHAUSTIVE_TESTS} " )
267265message (" ctime_tests ......................... ${SECP256K1_BUILD_CTIME_TESTS} " )
268266message (" examples ............................ ${SECP256K1_BUILD_EXAMPLES} " )
Original file line number Diff line number Diff line change 11{
2- "cmakeMinimumRequired" : {"major" : 3 , "minor" : 21 , "patch" : 0 },
2+ "cmakeMinimumRequired" : {"major" : 3 , "minor" : 21 , "patch" : 0 },
33 "version" : 3 ,
44 "configurePresets" : [
55 {
1414 "dev" : true ,
1515 "uninitialized" : true
1616 }
17+ },
18+ {
19+ "name" : " coverage" ,
20+ "displayName" : " Build for coverage analysis" ,
21+ "generator" : " Unix Makefiles" ,
22+ "cacheVariables" : {
23+ "CMAKE_C_COMPILER" : " gcc" ,
24+ "CMAKE_C_FLAGS" : " -DCOVERAGE=1 -g -O0 --coverage" ,
25+ "CMAKE_BUILD_TYPE" : " None" ,
26+ "SECP256K1_BUILD_VERIFY_TESTS" : " OFF"
27+ }
1728 }
1829 ]
1930}
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ if(SECP256K1_BUILD_TESTS)
5252 add_executable (noverify_tests tests.c)
5353 target_link_libraries (noverify_tests secp256k1_precomputed secp256k1_asm)
5454 add_test (noverify_tests noverify_tests)
55- if (NOT CMAKE_BUILD_TYPE STREQUAL "Coverage" )
56- add_executable (tests tests.c)
55+ if (SECP256K1_BUILD_VERIFY_TESTS )
56+ add_executable (tests tests.c ${internal_obj} )
5757 target_compile_definitions (tests PRIVATE VERIFY)
5858 target_link_libraries (tests secp256k1_precomputed secp256k1_asm)
5959 add_test (tests tests)
@@ -62,9 +62,9 @@ endif()
6262
6363if (SECP256K1_BUILD_EXHAUSTIVE_TESTS)
6464 # Note: do not include secp256k1_precomputed in exhaustive_tests (it uses runtime-generated tables).
65- add_executable (exhaustive_tests tests_exhaustive.c)
66- target_link_libraries (exhaustive_tests secp256k1_asm )
67- target_compile_definitions (exhaustive_tests PRIVATE $<$< NOT :$<CONFIG:Coverage>>:VERIFY> )
65+ add_executable (exhaustive_tests tests_exhaustive.c ${common_obj} )
66+ target_compile_definitions (exhaustive_tests PRIVATE $<$< NOT :$<CONFIG:None>>:VERIFY> )
67+ target_link_libraries (exhaustive_tests binary_interface )
6868 add_test (exhaustive_tests exhaustive_tests)
6969endif ()
7070
You can’t perform that action at this time.
0 commit comments