Add the command-line argument '--output-config' for generating configuration in test cases that increase the compatibility of message types and error codes
This commit is contained in:
parent
26c9b757de
commit
c25b6f1efe
|
@ -41,23 +41,23 @@ add_test(
|
||||||
)
|
)
|
||||||
|
|
||||||
if (${TD_LINUX})
|
if (${TD_LINUX})
|
||||||
# tmsg test
|
# tmsg test
|
||||||
add_executable(tmsgTest "")
|
add_executable(tmsgTest "")
|
||||||
target_sources(tmsgTest
|
target_sources(tmsgTest
|
||||||
PRIVATE
|
PRIVATE
|
||||||
"tmsgTest.cpp"
|
"tmsgTest.cpp"
|
||||||
"../src/tmsg.c"
|
"../src/tmsg.c"
|
||||||
)
|
)
|
||||||
target_include_directories(tmsgTest PUBLIC "${TD_SOURCE_DIR}/include/common/")
|
target_include_directories(tmsgTest PUBLIC "${TD_SOURCE_DIR}/include/common/")
|
||||||
target_link_libraries(tmsgTest PUBLIC os util gtest gtest_main)
|
target_link_libraries(tmsgTest PUBLIC os util gtest gtest_main)
|
||||||
add_test(
|
add_test(
|
||||||
NAME tmsgTest
|
NAME tmsgTest
|
||||||
COMMAND tmsgTest
|
COMMAND tmsgTest
|
||||||
)
|
)
|
||||||
|
|
||||||
# config file for msg type table
|
# config file for msg type table
|
||||||
SET(MSG_TBL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/msgTypeTable.ini)
|
SET(MSG_TBL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/msgTypeTable.ini)
|
||||||
add_custom_command(TARGET tmsgTest POST_BUILD
|
add_custom_command(TARGET tmsgTest POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MSG_TBL_FILE} $<TARGET_FILE_DIR:tmsgTest>
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MSG_TBL_FILE} $<TARGET_FILE_DIR:tmsgTest>
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
|
@ -127,17 +127,17 @@ add_test(
|
||||||
#)
|
#)
|
||||||
|
|
||||||
if (${TD_LINUX})
|
if (${TD_LINUX})
|
||||||
# terrorTest
|
# terrorTest
|
||||||
add_executable(terrorTest "terrorTest.cpp")
|
add_executable(terrorTest "terrorTest.cpp")
|
||||||
target_link_libraries(terrorTest os util common gtest_main)
|
target_link_libraries(terrorTest os util common gtest_main)
|
||||||
add_test(
|
add_test(
|
||||||
NAME terrorTest
|
NAME terrorTest
|
||||||
COMMAND terrorTest
|
COMMAND terrorTest
|
||||||
)
|
)
|
||||||
|
|
||||||
# config
|
# config
|
||||||
SET(ERR_TBL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/errorCodeTable.ini)
|
SET(ERR_TBL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/errorCodeTable.ini)
|
||||||
add_custom_command(TARGET terrorTest POST_BUILD
|
add_custom_command(TARGET terrorTest POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ERR_TBL_FILE} $<TARGET_FILE_DIR:terrorTest>
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ERR_TBL_FILE} $<TARGET_FILE_DIR:terrorTest>
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
Loading…
Reference in New Issue