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()
134
134
135
135
option (SECP256K1_BUILD_BENCHMARK "Build benchmarks." ON )
136
136
option (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 )
137
139
option (SECP256K1_BUILD_EXHAUSTIVE_TESTS "Build exhaustive tests." ON )
138
140
option (SECP256K1_BUILD_CTIME_TESTS "Build constant-time tests." ${SECP256K1_VALGRIND} )
139
141
option (SECP256K1_BUILD_EXAMPLES "Build examples." OFF )
@@ -258,11 +260,7 @@ endif()
258
260
message ("Optional binaries:" )
259
261
message (" benchmark ........................... ${SECP256K1_BUILD_BENCHMARK} " )
260
262
message (" 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} " )
266
264
message (" exhaustive tests .................... ${SECP256K1_BUILD_EXHAUSTIVE_TESTS} " )
267
265
message (" ctime_tests ......................... ${SECP256K1_BUILD_CTIME_TESTS} " )
268
266
message (" examples ............................ ${SECP256K1_BUILD_EXAMPLES} " )
Original file line number Diff line number Diff line change 1
1
{
2
- "cmakeMinimumRequired" : {"major" : 3 , "minor" : 21 , "patch" : 0 },
2
+ "cmakeMinimumRequired" : {"major" : 3 , "minor" : 21 , "patch" : 0 },
3
3
"version" : 3 ,
4
4
"configurePresets" : [
5
5
{
14
14
"dev" : true ,
15
15
"uninitialized" : true
16
16
}
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
+ }
17
28
}
18
29
]
19
30
}
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ if(SECP256K1_BUILD_TESTS)
52
52
add_executable (noverify_tests tests.c )
53
53
target_link_libraries (noverify_tests secp256k1_precomputed secp256k1_asm )
54
54
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} )
57
57
target_compile_definitions (tests PRIVATE VERIFY )
58
58
target_link_libraries (tests secp256k1_precomputed secp256k1_asm )
59
59
add_test (tests tests )
@@ -62,9 +62,9 @@ endif()
62
62
63
63
if (SECP256K1_BUILD_EXHAUSTIVE_TESTS )
64
64
# 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 )
68
68
add_test (exhaustive_tests exhaustive_tests )
69
69
endif ()
70
70
You can’t perform that action at this time.
0 commit comments