Skip to content

Commit

Permalink
cmake: Add option for disabling unit tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LukasWoodtli committed Feb 11, 2025
1 parent 535230c commit e636de9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ project(wakaama C)

include(wakaama.cmake)

# Enable "test" target
enable_testing()
add_subdirectory(tests)
option(WAKAAMA_UNIT_TESTS "Enable build of Unit Tests" ON)

if(WAKAAMA_UNIT_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ tools/ci/run_ci.sh --run-build
pytest -v tests/integration
```

### Disabling Unit Tests

Building the unit tests can be controlled by the CMake cache variable:

- `WAKAAMA_UNIT_TESTS`: The tests are enabled by default

## Examples

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

0 comments on commit e636de9

Please sign in to comment.