Adjust test names in CMake to be in line with autoconf ones
This commit is contained in:
parent
fae6b40002
commit
ffcca3964d
|
@ -286,9 +286,11 @@ if(ENABLE_TESTS)
|
|||
session subprocess tr-getopt utils variant watchdir watchdir@generic)
|
||||
set(TP ${TR_NAME}-test-${T})
|
||||
if(T MATCHES "^([^@]+)@.+$")
|
||||
string(REPLACE "@" "_" TP "${TP}")
|
||||
string(REPLACE "@" "-" TP "${TP}")
|
||||
string(REPLACE "@" "-" T_NAME "${T}")
|
||||
set(${TP}_TEST_BASENAME "${CMAKE_MATCH_1}")
|
||||
else()
|
||||
set(T_NAME "${T}")
|
||||
set(${TP}_TEST_BASENAME "${T}")
|
||||
endif()
|
||||
add_executable(${TP} ${${TP}_TEST_BASENAME}-test.c ${${T}-test_ADD_SOURCES})
|
||||
|
@ -296,7 +298,7 @@ if(ENABLE_TESTS)
|
|||
if(DEFINED ${T}-test_DEFINITIONS)
|
||||
target_compile_definitions(${TP} PRIVATE ${${T}-test_DEFINITIONS})
|
||||
endif()
|
||||
add_test(NAME ${T} COMMAND ${TP})
|
||||
add_test(NAME ${T_NAME}-test COMMAND ${TP})
|
||||
set_property(TARGET ${TP} PROPERTY FOLDER "UnitTests")
|
||||
endforeach()
|
||||
|
||||
|
|
Loading…
Reference in New Issue