Skip to content

Commit

Permalink
Set ALL_CPP_TESTS entry from TEST_NAME
Browse files Browse the repository at this point in the history
Changes to the setting of TEST_NAME disassociates the
list of tests in ALL_CPP_TESTS from the actual
executables. This sets the entry in ALL_CPP_TESTS
from TEST_NAME.
  • Loading branch information
Sam Yates committed Feb 6, 2015
1 parent 422e12f commit 9fecdfa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CommonCPPCTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ foreach(FILE ${TEST_FILES})
string(REGEX REPLACE "[./]" "_" NAME ${NAME})
source_group(\\ FILES ${FILE})

if(NAME MATCHES "^perf.*")
list(APPEND ALL_CPP_PERF_TESTS ${PROJECT_NAME}_${NAME})
else()
list(APPEND ALL_CPP_TESTS ${PROJECT_NAME}_${NAME})
endif()

set(TEST_NAME ${PROJECT_NAME}_${NAME})
if(NOT TARGET ${NAME}) # Create target without project prefix if possible
set(TEST_NAME ${NAME})
endif()

if(NAME MATCHES "^perf.*")
list(APPEND ALL_CPP_PERF_TESTS ${TEST_NAME})
else()
list(APPEND ALL_CPP_TESTS ${TEST_NAME})
endif()

add_executable(${TEST_NAME} ${FILE})
set_target_properties(${TEST_NAME} PROPERTIES FOLDER "Tests"
OUTPUT_NAME ${NAME})
Expand Down

0 comments on commit 9fecdfa

Please sign in to comment.