Commit fea27536 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Fix add_test() calls to use $<TARGET_FILE:..>.

Using add_test() call with $<TARGET_FILE:..> overcomes the issues with test not
finding the executable correctly.
parent 997933e2
......@@ -30,14 +30,6 @@ SET(EXECUTABLE_OUTPUT_PATH ${ICET_BINARY_DIR}/bin CACHE PATH
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
SET(ICET_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH})
SET(ICET_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH})
SET(C_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
# CMAKE_CONFIGURATION_TYPES is set for generators that support multiple
# configurations e.g. Visual Studio. In that case we update the C_TEST_PATH to
# include the configuration type (CTEST_CONFIGURATION_TYPE)
IF (CMAKE_CONFIGURATION_TYPES)
SET (C_TEST_PATH ${C_TEST_PATH}/\${CTEST_CONFIGURATION_TYPE})
ENDIF(CMAKE_CONFIGURATION_TYPES)
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
......
......@@ -78,9 +78,10 @@ SEPARATE_ARGUMENTS(ICET_TEST_FLAGS)
FOREACH (test ${MyTests})
GET_FILENAME_COMPONENT(TName ${test} NAME_WE)
ADD_TEST(IceT${TName}
ADD_TEST(NAME IceT${TName}
COMMAND
${PRE_TEST_FLAGS}
${C_TEST_PATH}/icetTests_mpi ${ICET_TEST_FLAGS} ${TName}
$<TARGET_FILE:icetTests_mpi> ${ICET_TEST_FLAGS} ${TName}
${POST_TEST_FLAGS})
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.1)
SET_TESTS_PROPERTIES(IceT${TName}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment