summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-16 22:46:02 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-21 20:44:26 +0000
commit7245ac11ef9be2420c8356c12acc79f93ea211bb (patch)
treee971c5c6e10c2310afe4b2cd80212feac9839f2a /CMakeLists.txt
parent7c2b95ef5e4ccdae01bd104aa7400294c9ea391b (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.txt15
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
374add_library(misc_tools
375 testing/misc_tools.c
376 testing/misc_tools.h)
377target_link_modules(misc_tools toxcore)
378
374set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified") 379set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified")
375 380
376if(ANDROID_CPU_FEATURES) 381if(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)
463endif() 468endif()
464 469
465option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON) 470option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON)
@@ -519,12 +524,12 @@ endif()
519 524
520add_executable(DHT_test ${CPUFEATURES} 525add_executable(DHT_test ${CPUFEATURES}
521 testing/DHT_test.c) 526 testing/DHT_test.c)
522target_link_modules(DHT_test toxcore) 527target_link_modules(DHT_test toxcore misc_tools)
523 528
524add_executable(Messenger_test ${CPUFEATURES} 529add_executable(Messenger_test ${CPUFEATURES}
525 testing/Messenger_test.c) 530 testing/Messenger_test.c)
526target_link_modules(Messenger_test toxcore) 531target_link_modules(Messenger_test toxcore misc_tools)
527 532
528add_executable(random_testing ${CPUFEATURES} 533add_executable(random_testing ${CPUFEATURES}
529 testing/random_testing.cc) 534 testing/random_testing.cc)
530target_link_modules(random_testing toxcore) 535target_link_modules(random_testing toxcore misc_tools)