Skip to content

Add test that builds public headers #1693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ if(SECP256K1_BUILD_TESTS)
target_link_libraries(tests secp256k1_precomputed secp256k1_asm)
add_test(NAME secp256k1_tests COMMAND tests)
endif()
add_subdirectory(test)
endif()

if(SECP256K1_BUILD_EXHAUSTIVE_TESTS)
Expand Down
18 changes: 18 additions & 0 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# OBJECT library, because were are not interested in linking this.
# EXCLUDE_FROM_ALL, because it is explicitly built as a test.
add_library(secp256k1_build_public_headers OBJECT EXCLUDE_FROM_ALL
secp256k1.c
secp256k1_ecdh.c
secp256k1_ellswift.c
secp256k1_extrakeys.c
secp256k1_musig.c
secp256k1_preallocated.c
secp256k1_recovery.c
secp256k1_schnorrsig.c
)

add_test(NAME secp256k1_build_public_headers COMMAND ${CMAKE_COMMAND}
--build ${CMAKE_BINARY_DIR}
--target secp256k1_build_public_headers
--config $<CONFIG>
)
1 change: 1 addition & 0 deletions src/test/secp256k1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1.h"
1 change: 1 addition & 0 deletions src/test/secp256k1_ecdh.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1_ecdh.h"
1 change: 1 addition & 0 deletions src/test/secp256k1_ellswift.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1_ellswift.h"
1 change: 1 addition & 0 deletions src/test/secp256k1_extrakeys.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1_extrakeys.h"
1 change: 1 addition & 0 deletions src/test/secp256k1_musig.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1_musig.h"
1 change: 1 addition & 0 deletions src/test/secp256k1_preallocated.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1_preallocated.h"
1 change: 1 addition & 0 deletions src/test/secp256k1_recovery.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1_recovery.h"
1 change: 1 addition & 0 deletions src/test/secp256k1_schnorrsig.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../../include/secp256k1_schnorrsig.h"