LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
 All Classes Files Functions Variables Typedefs Macros
runtest.cmake
Go to the documentation of this file.
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}")
12  endif()
13  endif()
14 endif()
15 set(ARGS )
16 if(DEFINED OUTPUT)
17  set(ARGS OUTPUT_FILE "${OUTPUT}" ERROR_FILE "${OUTPUT}.err")
18 endif()
19 if(DEFINED INPUT)
20  list(APPEND ARGS INPUT_FILE "${INPUT}")
21 endif()
22 message("Running: ${TEST}")
23 message("ARGS= ${ARGS}")
24 execute_process(COMMAND "${TEST}"
25  ${ARGS}
26  RESULT_VARIABLE RET)
27 if(DEFINED OUTPUT)
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}")
32 endif()
33 
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}")
37 endif()
38 message( "Test ${TEST} returned ${RET}")
Description INPUT
string(REPLACE"${INTDIR}""$ENV{CMAKE_CONFIG_TYPE}"TEST"${TEST}") if("$ENV
Definition: runtest.cmake:7
debian since it interferes with the way the OPTS variable must be set
Definition: changelog:386
subroutine ctest(LEN, CCOMP, CTRUE, CSIZE, SFAC)
Definition: cblat1.f:654