]> https://gitweb.dealii.org/ - dealii.git/commitdiff
quicktests: force the deletion of old -OK files
authorTimo Heister <timo.heister@gmail.com>
Sun, 8 Dec 2013 00:48:40 +0000 (00:48 +0000)
committerTimo Heister <timo.heister@gmail.com>
Sun, 8 Dec 2013 00:48:40 +0000 (00:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@31928 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/tests/quick_tests/CMakeLists.txt

index 930c811caabd94d963682bcdd4a1cbbf587555e9..f8dec2f061751e191fe8f9a64dcc019558defe40 100644 (file)
@@ -34,20 +34,31 @@ MACRO(make_quicktest test_basename build_name mpi_run)
   IF(NOT ${mpi_run} EQUAL "")
   ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK
     DEPENDS ${_target}
+    DEPENDS kill-${_target}-OK
     COMMAND mpirun -n ${mpi_run} ./${_target} > ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK 2>&1 || (rm ${_target}-OK  && exit 1)
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     )
   ELSE()
-  ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK
+  ADD_CUSTOM_TARGET(${_target}-OK
     DEPENDS ${_target}
+    DEPENDS kill-${_target}-OK
     COMMAND ./${_target} > ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK 2>&1 || (cat ${_target}-OK && rm ${_target}-OK  && exit 1)
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     )
   ENDIF()
 
+  # this is a hack to make sure the -OK file is deleted
+  ADD_CUSTOM_TARGET(kill-${_target}-OK
+       COMMAND rm -f ${_target}-OK 
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    )
+
+  # make sure kill is run before the other two:
+  ADD_DEPENDENCIES(${_target} kill-${_target}-OK)
+
   ADD_CUSTOM_TARGET(${_target}.run
     DEPENDS ${_target}
-    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK
+    DEPENDS ${_target}-OK
     COMMAND echo "${_target}: PASSED.")
 
   ADD_TEST(NAME ${_target}

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.