Skip to content

Commit

Permalink
chore: Add cmake flag to disable unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Mar 26, 2024
1 parent 7df3f99 commit f904179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ endif()
option(BUILD_MISC_TESTS "Build additional tests" OFF)
option(BUILD_FUN_UTILS "Build additional just for fun utilities" OFF)

option(UNITTEST "Enable unit tests (disable if you don't have a working gmock or gtest)" ON)

option(AUTOTEST "Enable autotests (mainly for CI)" OFF)
if(AUTOTEST)
option(NON_HERMETIC_TESTS "Whether to build and run tests that depend on an internet connection" OFF)
Expand Down Expand Up @@ -534,7 +536,7 @@ endfunction()

# The actual unit tests follow.
#
if(TARGET GTest::gtest AND TARGET GTest::gmock)
if(UNITTEST AND TARGET GTest::gtest AND TARGET GTest::gmock)
unit_test(toxav ring_buffer)
unit_test(toxav rtp)
unit_test(toxcore DHT)
Expand Down
1 change: 1 addition & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ There are some options that are available to configure the build.
| `PROXY_TEST` | Enable proxy test (requires `other/proxy/proxy_server.go` to be running). | ON or OFF | OFF |
| `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. |
| `UNITTEST` | Enable unit tests (disable if you don't have a working gmock or gtest). | ON or OFF | ON |
| `USE_IPV6` | Use IPv6 in tests. | ON or OFF | ON |

You can get this list of option using the following commands
Expand Down

0 comments on commit f904179

Please sign in to comment.