]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: add_test(): remove compilation interrupt guard
authorMatthias Maier <tamiko@43-1.org>
Tue, 24 Jan 2023 03:06:55 +0000 (21:06 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 25 Jan 2023 23:26:29 +0000 (17:26 -0600)
cmake/macros/macro_deal_ii_add_test.cmake
cmake/scripts/run_test.cmake

index b14cce2bc77d2c1db91aa6fbe4ffbf588b5bfea3..87cdd40288b21da2fd9209984055f7b4a4e5b95b 100644 (file)
@@ -446,21 +446,10 @@ function(deal_ii_add_test _category _test_name _comparison_file)
       #
 
       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})
@@ -507,7 +496,6 @@ function(deal_ii_add_test _category _test_name _comparison_file)
             -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}
           )
@@ -593,7 +581,6 @@ function(deal_ii_add_test _category _test_name _comparison_file)
             -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}
           )
@@ -611,7 +598,6 @@ function(deal_ii_add_test _category _test_name _comparison_file)
             -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}
           )
index d06f8b7afb6d2d79c911a1f5529e153c2dd51bb8..cf9271cdd7a24f078cd69d758e71a2705125e15f 100644 (file)
 #            (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")
@@ -127,14 +107,6 @@ endif()
 
 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:
 #

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.