tests: 调整测试程序名称获取方式

This commit is contained in:
wxf 2021-07-15 10:32:40 +08:00
parent 0d48275115
commit e679404701

View File

@ -8,7 +8,8 @@ foreach (TEST_SRC ${TEST_SRC_LIST})
continue()
endif ()
endif ()
STRING(REGEX REPLACE "^\\./|\\.c[a-zA-Z0-9_]*$" "" TEST_EXE_NAME ${TEST_SRC})
get_filename_component(TEST_EXE_NAME ${TEST_SRC} NAME_WE)
message(STATUS "add test:${TEST_EXE_NAME}")
add_executable(${TEST_EXE_NAME} ${TEST_SRC})