Skip to content

Commit

Permalink
Add prefix with type of test for Ctest names (hyperledger-iroha#1307)
Browse files Browse the repository at this point in the history
Signed-off-by: Fedor Muratov <[email protected]>
  • Loading branch information
muratovv authored May 14, 2018
1 parent f5377c9 commit 2976fac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ function(addtest test_name SOURCES)
add_executable(${test_name} ${SOURCES})
target_link_libraries(${test_name} gtest gmock)
target_include_directories(${test_name} PUBLIC ${PROJECT_SOURCE_DIR}/test)

# fetch directory after test in source dir call
# for example:
# "/Users/user/iroha/test/integration/acceptance"
# match to "integration"
string(REGEX REPLACE ".*test\\/([a-zA-Z]+).*" "\\1" output ${CMAKE_CURRENT_SOURCE_DIR})

add_test(
NAME ${test_name}
NAME "${output}_${test_name}"
COMMAND $<TARGET_FILE:${test_name}> ${test_xml_output}
)
if (NOT MSVC)
Expand Down

0 comments on commit 2976fac

Please sign in to comment.