mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Improve ctest unit test naming and filtering
This commit is contained in:
@@ -424,7 +424,7 @@ include(px4_add_gtest)
|
|||||||
|
|
||||||
if(unit_testing)
|
if(unit_testing)
|
||||||
include(gtest)
|
include(gtest)
|
||||||
add_custom_target(unit_test COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} -V -R Test USES_TERMINAL)
|
add_custom_target(unit_test COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} -V -R UnitTest- USES_TERMINAL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
@@ -50,8 +50,10 @@ function(px4_add_gtest)
|
|||||||
REQUIRED SRC
|
REQUIRED SRC
|
||||||
ARGN ${ARGN})
|
ARGN ${ARGN})
|
||||||
|
|
||||||
# infer test name from source filname without extension
|
# infer test name from source filname
|
||||||
get_filename_component(TESTNAME ${SRC} NAME_WE)
|
get_filename_component(TESTNAME ${SRC} NAME_WE)
|
||||||
|
string(REPLACE Test "" TESTNAME ${TESTNAME})
|
||||||
|
set(TESTNAME UnitTest-${TESTNAME})
|
||||||
|
|
||||||
# build a binary for the unit test
|
# build a binary for the unit test
|
||||||
add_executable(${TESTNAME} EXCLUDE_FROM_ALL ${SRC})
|
add_executable(${TESTNAME} EXCLUDE_FROM_ALL ${SRC})
|
||||||
|
|||||||
Reference in New Issue
Block a user