diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-16 22:46:02 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-21 20:44:26 +0000 |
commit | 7245ac11ef9be2420c8356c12acc79f93ea211bb (patch) | |
tree | e971c5c6e10c2310afe4b2cd80212feac9839f2a /CMakeLists.txt | |
parent | 7c2b95ef5e4ccdae01bd104aa7400294c9ea391b (diff) |
Avoid implementations in .h files or #including .c files.
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd0e9944..181d4155 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -371,6 +371,11 @@ unit_test(toxcore util) | |||
371 | # | 371 | # |
372 | ################################################################################ | 372 | ################################################################################ |
373 | 373 | ||
374 | add_library(misc_tools | ||
375 | testing/misc_tools.c | ||
376 | testing/misc_tools.h) | ||
377 | target_link_modules(misc_tools toxcore) | ||
378 | |||
374 | set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified") | 379 | set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified") |
375 | 380 | ||
376 | if(ANDROID_CPU_FEATURES) | 381 | if(ANDROID_CPU_FEATURES) |
@@ -389,7 +394,7 @@ function(auto_test target) | |||
389 | if(NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD")) | 394 | if(NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD")) |
390 | add_executable(auto_${target}_test ${CPUFEATURES} | 395 | add_executable(auto_${target}_test ${CPUFEATURES} |
391 | auto_tests/${target}_test.c) | 396 | auto_tests/${target}_test.c) |
392 | target_link_modules(auto_${target}_test toxcore) | 397 | target_link_modules(auto_${target}_test toxcore misc_tools) |
393 | if(NOT ARGV1 STREQUAL "DONT_RUN") | 398 | if(NOT ARGV1 STREQUAL "DONT_RUN") |
394 | add_test(NAME ${target} COMMAND ${CROSSCOMPILING_EMULATOR} auto_${target}_test) | 399 | add_test(NAME ${target} COMMAND ${CROSSCOMPILING_EMULATOR} auto_${target}_test) |
395 | set_tests_properties(${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}") | 400 | set_tests_properties(${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}") |
@@ -459,7 +464,7 @@ if(DHT_BOOTSTRAP) | |||
459 | add_executable(DHT_bootstrap ${CPUFEATURES} | 464 | add_executable(DHT_bootstrap ${CPUFEATURES} |
460 | other/DHT_bootstrap.c | 465 | other/DHT_bootstrap.c |
461 | other/bootstrap_node_packets.c) | 466 | other/bootstrap_node_packets.c) |
462 | target_link_modules(DHT_bootstrap toxcore) | 467 | target_link_modules(DHT_bootstrap toxcore misc_tools) |
463 | endif() | 468 | endif() |
464 | 469 | ||
465 | option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON) | 470 | option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON) |
@@ -519,12 +524,12 @@ endif() | |||
519 | 524 | ||
520 | add_executable(DHT_test ${CPUFEATURES} | 525 | add_executable(DHT_test ${CPUFEATURES} |
521 | testing/DHT_test.c) | 526 | testing/DHT_test.c) |
522 | target_link_modules(DHT_test toxcore) | 527 | target_link_modules(DHT_test toxcore misc_tools) |
523 | 528 | ||
524 | add_executable(Messenger_test ${CPUFEATURES} | 529 | add_executable(Messenger_test ${CPUFEATURES} |
525 | testing/Messenger_test.c) | 530 | testing/Messenger_test.c) |
526 | target_link_modules(Messenger_test toxcore) | 531 | target_link_modules(Messenger_test toxcore misc_tools) |
527 | 532 | ||
528 | add_executable(random_testing ${CPUFEATURES} | 533 | add_executable(random_testing ${CPUFEATURES} |
529 | testing/random_testing.cc) | 534 | testing/random_testing.cc) |
530 | target_link_modules(random_testing toxcore) | 535 | target_link_modules(random_testing toxcore misc_tools) |