Skip to content

Commit

Permalink
Add cmake option for building additional tests
Browse files Browse the repository at this point in the history
Closes #1262
  • Loading branch information
zugz committed Dec 11, 2018
1 parent 9770880 commit 0f8f82a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 16 deletions.
33 changes: 18 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,21 @@ if(NOT WIN32
endif()
endif()

add_executable(DHT_test ${CPUFEATURES}
testing/DHT_test.c)
target_link_modules(DHT_test toxcore misc_tools)

add_executable(Messenger_test ${CPUFEATURES}
testing/Messenger_test.c)
target_link_modules(Messenger_test toxcore misc_tools)

add_executable(random_testing ${CPUFEATURES}
testing/random_testing.cc)
target_link_modules(random_testing toxcore misc_tools)

add_executable(save-generator
other/fun/save-generator.c)
target_link_modules(save-generator toxcore misc_tools)
option(BUILD_MISC_TESTS "Build additional tests" OFF)
if (BUILD_MISC_TESTS)
add_executable(DHT_test ${CPUFEATURES}
testing/DHT_test.c)
target_link_modules(DHT_test toxcore misc_tools)

add_executable(Messenger_test ${CPUFEATURES}
testing/Messenger_test.c)
target_link_modules(Messenger_test toxcore misc_tools)

add_executable(random_testing ${CPUFEATURES}
testing/random_testing.cc)
target_link_modules(random_testing toxcore misc_tools)

add_executable(save-generator
other/fun/save-generator.c)
target_link_modules(save-generator toxcore misc_tools)
endif()
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ There are some options that are available to configure the build.

| Name | Description | Expected Value | Default Value |
|------------------------|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|---------------------------------------------------|
| `AUTOTEST` | Enable autotests (mainly for CI). | ON or OFF | OFF |
| `BOOTSTRAP_DAEMON` | Enable building of tox-bootstrapd, the DHT bootstrap node daemon. For Unix-like systems only. | ON or OFF | ON |
| `BUILD_AV_TEST` | Build toxav test. | ON or OFF | ON |
| `BUILD_MISC_TESTS` | Build additional tests. | ON or OFF | OFF |
| `BUILD_TOXAV` | Whether to build the tox AV library. | ON or OFF | ON |
| `CMAKE_INSTALL_PREFIX` | Path to where everything should be installed. | Directory path. | Platform-dependent. Refer to CMake documentation. |
| `DHT_BOOTSTRAP` | Enable building of `DHT_bootstrap` | ON or OFF | ON |
Expand All @@ -94,7 +96,6 @@ There are some options that are available to configure the build.
| `STRICT_ABI` | Enforce strict ABI export in dynamic libraries. | ON or OFF | OFF |
| `TEST_TIMEOUT_SECONDS` | Limit runtime of each test to the number of seconds specified. | Positive number or nothing (empty string). | Empty string. |
| `USE_IPV6` | Use IPv6 in tests. | ON or OFF | ON |
| `AUTOTEST` | Enable autotests (mainly for CI). | ON or OFF | OFF |

You can get this list of option using the following commands

Expand Down
22 changes: 22 additions & 0 deletions cmake/StrictAbi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,25 @@ if(WIN32 OR APPLE)
# Windows and OSX don't have this linker functionality.
set(STRICT_ABI OFF)
endif()

if(STRICT_ABI)
if(AUTOTEST)
message("AUTOTEST option is incompatible with STRICT_ABI. Disabling AUTOTEST.")
endif()
set(AUTOTEST OFF)

if(BUILD_MISC_TESTS)
message("BUILD_MISC_TESTS option is incompatible with STRICT_ABI. Disabling BUILD_MISC_TESTS.")
endif()
set(BUILD_MISC_TESTS OFF)

if(BOOTSTRAP_DAEMON)
message("BOOTSTRAP_DAEMON option is incompatible with STRICT_ABI. Disabling BOOTSTRAP_DAEMON.")
endif()
set(BOOTSTRAP_DAEMON OFF)

if(DHT_BOOTSTRAP)
message("DHT_BOOTSTRAP option is incompatible with STRICT_ABI. Disabling DHT_BOOTSTRAP.")
endif()
set(DHT_BOOTSTRAP OFF)
endif()

0 comments on commit 0f8f82a

Please sign in to comment.