1 # Replace INTDIR with the value of $ENV{CMAKE_CONFIG_TYPE} that is set
2 # by ctest when -C Debug|Releaes|etc is given, and INDIR is passed
3 # in from the main cmake run and is the variable that is used
4 # by the build system to specify the build directory
5 if(NOT
"${INTDIR}" STREQUAL
".")
6 set(TEST_ORIG
"${TEST}")
7 string(REPLACE "${INTDIR}
" "$ENV{CMAKE_CONFIG_TYPE}
" TEST "${TEST}
")
8 if("$ENV{CMAKE_CONFIG_TYPE}
" STREQUAL "")
9 if(NOT EXISTS "${TEST}
")
10 message("Warning: CMAKE_CONFIG_TYPE not defined did you forget the -C option
for ctest?
")
11 message(FATAL_ERROR "Could not find test executable: ${TEST_ORIG}
")
17 set(ARGS OUTPUT_FILE "${OUTPUT}
" ERROR_FILE "${OUTPUT}.err
")
20 list(APPEND ARGS INPUT_FILE "${
INPUT}
")
22 message("Running: ${TEST}
")
23 message("ARGS= ${ARGS}
")
24 execute_process(COMMAND "${TEST}
"
28 file(READ "${OUTPUT}
" TEST_OUTPUT)
29 file(READ "${OUTPUT}.err
" TEST_ERROR)
30 message("Test OUTPUT:\n${TEST_OUTPUT}
")
31 message("Test ERROR:\n${TEST_ERROR}
")
34 # if the test does not return 0, then fail it
35 if(NOT ${RET} EQUAL 0)
36 message(FATAL_ERROR "Test ${TEST} returned ${RET}
")
38 message( "Test ${TEST} returned ${RET}
")
string(REPLACE"${INTDIR}""$ENV{CMAKE_CONFIG_TYPE}"TEST"${TEST}") if("$ENV
debian since it interferes with the way the OPTS variable must be set
subroutine ctest(LEN, CCOMP, CTRUE, CSIZE, SFAC)