Skip to content

Commit

Permalink
Fix tests makefile.
Browse files Browse the repository at this point in the history
The tests makefile only supports simple test programs.
Use include instead of additional object files.

Signed-off-by: Achim Kraus <[email protected]>
  • Loading branch information
boaks committed Jan 25, 2023
1 parent 64e3018 commit 7919e5c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.5)

project(tinydtls-tests)

add_executable(dtls-server dtls-server.c dtls_ciphers_util.c)
add_executable(dtls-server dtls-server.c)
target_link_libraries(dtls-server LINK_PUBLIC tinydtls)
target_compile_options(dtls-server PUBLIC -Wall -DTEST_INCLUDE -DDTLSv12 -DWITH_SHA256)
if(${WARNING_TO_ERROR})
Expand All @@ -37,7 +37,7 @@ if(${WARNING_TO_ERROR})
target_compile_options(ccm-test PUBLIC -Werror)
endif()

add_executable(dtls-client dtls-client.c dtls_ciphers_util.c)
add_executable(dtls-client dtls-client.c)
target_link_libraries(dtls-client LINK_PUBLIC tinydtls)
target_compile_options(dtls-client PUBLIC -Wall -DTEST_INCLUDE -DDTLSv12 -DWITH_SHA256)
if(${WARNING_TO_ERROR})
Expand Down
2 changes: 2 additions & 0 deletions tests/dtls-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,3 +609,5 @@ main(int argc, char **argv) {
dtls_free_context(orig_dtls_context);
exit(0);
}

#include "dtls_ciphers_util.c"
3 changes: 3 additions & 0 deletions tests/dtls-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,3 +480,6 @@ main(int argc, char **argv) {
dtls_free_context(the_context);
exit(0);
}

#include "dtls_ciphers_util.c"

0 comments on commit 7919e5c

Please sign in to comment.