[test] use cmake to run unit tests (#8724)

This commit migrates unit tests to cmake.
* build unit tests with cmake
* add missing tests in cmake
* use ctest
* add platform udp stubs for test platform
* skip some static_assert with gcc-4
This commit is contained in:
Yakun Xu
2023-02-10 02:19:01 +08:00
committed by GitHub
parent 6e6a2ae145
commit 0e667b8e03
19 changed files with 273 additions and 472 deletions
+1 -4
View File
@@ -33,6 +33,7 @@ file(READ .default-version OT_DEFAULT_VERSION)
string(STRIP ${OT_DEFAULT_VERSION} OT_DEFAULT_VERSION)
project(openthread VERSION ${OT_DEFAULT_VERSION})
include(CTest)
option(OT_BUILD_EXECUTABLES "Build executables" ON)
option(OT_COVERAGE "enable coverage" OFF)
@@ -204,10 +205,6 @@ endif()
add_subdirectory(src)
add_subdirectory(third_party EXCLUDE_FROM_ALL)
if(OT_PLATFORM STREQUAL "simulation")
enable_testing()
endif()
add_subdirectory(tests)
add_subdirectory(tools)