Skip to content

Commit e636de9

Browse files
committed
cmake: Add option for disabling unit tests
Building the unit tests can now be disabled with a CMake cache variable. This is useful on platforms where `CUnit` is not available or when working on an embedded platform.
1 parent 535230c commit e636de9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ project(wakaama C)
44

55
include(wakaama.cmake)
66

7-
# Enable "test" target
8-
enable_testing()
9-
add_subdirectory(tests)
7+
option(WAKAAMA_UNIT_TESTS "Enable build of Unit Tests" ON)
8+
9+
if(WAKAAMA_UNIT_TESTS)
10+
enable_testing()
11+
add_subdirectory(tests)
12+
endif()

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ tools/ci/run_ci.sh --run-build
172172
pytest -v tests/integration
173173
```
174174

175+
### Disabling Unit Tests
176+
177+
Building the unit tests can be controlled by the CMake cache variable:
178+
179+
- `WAKAAMA_UNIT_TESTS`: The tests are enabled by default
180+
175181
## Examples
176182

177183
There are some example applications provided to test the server, client and bootstrap capabilities of Wakaama.

0 commit comments

Comments
 (0)