#
if(NOT TARGET ${_target})
- #
- # Add a "guard file" rule: The purpose of interrupt_guard.cc is to
- # force a complete rerun of this test (BUILD, RUN and DIFF stage)
- # if interrupt_guard.cc is removed by run_test.cmake due to an
- # interruption.
- #
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc
- COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc
- )
add_executable(${_target} EXCLUDE_FROM_ALL
${_generated_files}
${_source_file}
- ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc
)
set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_target_short})
-DTEST=${_test_executable_full}
-DEXPECT=PASSED
-DBINARY_DIR=${CMAKE_BINARY_DIR}
- -DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_build_lowercase}/interrupt_guard.cc
-P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
WORKING_DIRECTORY ${_test_directory}
)
-DTEST=${_test_full}
-DEXPECT=${_expect}
-DBINARY_DIR=${CMAKE_BINARY_DIR}
- # no guard file
-P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
WORKING_DIRECTORY ${_test_directory}
)
-DTEST=${_test_full}
-DEXPECT=${_expect}
-DBINARY_DIR=${CMAKE_BINARY_DIR}
- -DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_build_lowercase}/interrupt_guard.cc
-P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
WORKING_DIRECTORY ${_test_directory}
)
# (return value 0)
# Possible values are CONFIGURE, BUILD, RUN, DIFF, PASSED
#
-# GUARD_FILE - used to detect a forced interruption of this script: On
-# startup the backed up file ${GUARD_FILE}_bck is put back
-# in place as ${GUARD_FILE} and on exit ${GUARD_FILE} is
-# backed up as ${GUARD_FILE}_bck. If on startup a stale
-# ${GUARD_FILE} is found, it is deleted.
-#
-
-if(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE})
- #
- # Guard file still exists, so this script must have been interrupted.
- # Remove guard file to force a complete rerun:
- #
- execute_process(COMMAND rm -f ${GUARD_FILE})
-elseif(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE}_bck)
- #
- # A backed up guard file exists. Put it back in place:
- #
- execute_process(COMMAND mv ${GUARD_FILE}_bck ${GUARD_FILE})
-endif()
-
if("${EXPECT}" STREQUAL "")
set(EXPECT "PASSED")
message("=============================== OUTPUT END ===============================")
-#
-# Back up guard file:
-#
-
-if(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE})
- execute_process(COMMAND mv ${GUARD_FILE} ${GUARD_FILE}_bck)
-endif()
-
#
# Bail out:
#