mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 23:57:47 +00:00
[cmake] guard unit tests with BUILD_TESTING (#8739)
This commit is contained in:
@@ -85,10 +85,12 @@ target_link_libraries(openthread-spinel-rcp
|
||||
ot-config
|
||||
)
|
||||
|
||||
add_executable(ot-test-spinel
|
||||
spinel.c
|
||||
)
|
||||
target_compile_definitions(ot-test-spinel
|
||||
PRIVATE -DSPINEL_SELF_TEST=1 -D_GNU_SOURCE
|
||||
)
|
||||
add_test(NAME ot-test-spinel COMMAND ot-test-spinel)
|
||||
if(BUILD_TESTING)
|
||||
add_executable(ot-test-spinel
|
||||
spinel.c
|
||||
)
|
||||
target_compile_definitions(ot-test-spinel
|
||||
PRIVATE -DSPINEL_SELF_TEST=1 -D_GNU_SOURCE
|
||||
)
|
||||
add_test(NAME ot-test-spinel COMMAND ot-test-spinel)
|
||||
endif()
|
||||
|
||||
+12
-10
@@ -32,13 +32,15 @@ add_library(openthread-url EXCLUDE_FROM_ALL
|
||||
|
||||
target_link_libraries(openthread-url PRIVATE ot-config)
|
||||
|
||||
add_executable(ot-test-url
|
||||
url.cpp
|
||||
)
|
||||
target_compile_definitions(ot-test-url
|
||||
PRIVATE -DSELF_TEST=1
|
||||
)
|
||||
target_link_libraries(ot-test-url
|
||||
PRIVATE ot-config
|
||||
)
|
||||
add_test(NAME ot-test-url COMMAND ot-test-url)
|
||||
if(BUILD_TESTING)
|
||||
add_executable(ot-test-url
|
||||
url.cpp
|
||||
)
|
||||
target_compile_definitions(ot-test-url
|
||||
PRIVATE -DSELF_TEST=1
|
||||
)
|
||||
target_link_libraries(ot-test-url
|
||||
PRIVATE ot-config
|
||||
)
|
||||
add_test(NAME ot-test-url COMMAND ot-test-url)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user