]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Quick fix
authorMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 23 Aug 2013 00:55:44 +0000 (00:55 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 23 Aug 2013 00:55:44 +0000 (00:55 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30443 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_deal_ii_add_test.cmake
deal.II/cmake/scripts/run_test.cmake

index d25da5d0c9ee1cfd0d3baf051a6f301a7e3ee9b5..2d2dd4c8f84b488252f34928600ca1239d7af009 100644 (file)
@@ -37,8 +37,6 @@
 #   - specifying the maximal wall clock time in seconds a test is allowed
 #     to run
 #
-# TODO: LABEL and MEASUREMENT
-#
 # Usage:
 #     DEAL_II_ADD_TEST(category test_name [configurations])
 #
@@ -54,6 +52,10 @@ MACRO(DEAL_II_ADD_TEST _category _test_name)
       SET(_test ${_test_name}.${_build_lowercase})
       SET(_full_test ${_category}-${_test_name}.${_build_lowercase})
 
+      #
+      # Add an executable for the current test and set up compile
+      # definitions and the full link interface:
+      #
       ADD_EXECUTABLE(${_full_test} EXCLUDE_FROM_ALL ${_test_name}.cc)
 
       SET_TARGET_PROPERTIES(${_full_test} PROPERTIES
@@ -78,19 +80,17 @@ MACRO(DEAL_II_ADD_TEST _category _test_name)
         )
 
 
+      #
+      # Add a top level target to run the test and compare the output:
+      #
       ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
         COMMAND ${_full_test}
-        # TODO: Refactor:
         COMMAND ${PERL_EXECUTABLE} -pi
             ${CMAKE_SOURCE_DIR}/cmake/scripts/normalize.pl
             ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_test}
         DEPENDS ${_full_test} ${CMAKE_SOURCE_DIR}/cmake/scripts/normalize.pl
         )
-      ADD_CUSTOM_TARGET(${_full_test}.run
-        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
-        )
-
 
       SET(_comparison ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name})
       IF(EXISTS ${_comparison}.${_build_lowercase}.output)
@@ -99,7 +99,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name)
         SET(_comparison ${_comparison}.output)
       ENDIF()
 
-      ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff
+      ADD_CUSTOM_TARGET(${_full_test}.diff
         COMMAND ${DEAL_II_TEST_DIFF}
           ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
           ${_comparison}
@@ -108,18 +108,14 @@ MACRO(DEAL_II_ADD_TEST _category _test_name)
           ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
           ${_comparison}
         )
-      ADD_CUSTOM_TARGET(${_full_test}.diff
-        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff
-        )
 
-      IF(CMAKE_GENERATOR MATCHES "Makefiles")
-        SET(_test_suffix "/fast")
-      ENDIF()
 
+      #
+      # And finally add the test:
+      #
       ADD_TEST(NAME ${_category}/${_test}
         COMMAND ${CMAKE_COMMAND}
           -DTEST=${_full_test}
-          -DTEST_SUFFIX=${_test_suffix}
           -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
           -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_test}
index 7df9678e02cf6e1d9de7297b46e6a2ff761a02f1..9d52b2e0baf26730cc68f45501522955ea9a544a 100644 (file)
@@ -2,38 +2,23 @@
 # TODO: The following variables have to be set:
 #
 # TEST
-# TEST_SUFFIX
 # DEAL_II_BINARY_DIR
 #
 
-MACRO(CALLBACK _target _target_suffix _msg_success _msg_error)
-  EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
-    --build ${DEAL_II_BINARY_DIR} --target ${_target}${_target_suffix}
-    RESULT_VARIABLE _result_code
-    OUTPUT_VARIABLE _output
-    )
-
-  IF("${_result_code}" STREQUAL "0")
-    MESSAGE("${_target}: ${_msg_success}.")
-
-  ELSE()
-
-    MESSAGE("*** ${_msg_error}: ***")
-    MESSAGE(${_output})
-    MESSAGE(FATAL_ERROR "*** Test aborted.")
-  ENDIF()
-ENDMACRO()
-
-
-CALLBACK(${TEST} "${TEST_SUFFIX}"
-  "Build successful" "BUILD FAILED"
+EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
+  --build ${DEAL_II_BINARY_DIR} --target ${TEST}.diff
+  RESULT_VARIABLE _result_code
+  OUTPUT_VARIABLE _output
   )
 
-CALLBACK(${TEST} ".run${TEST_SUFFIX}"
-  "Run successful" "RUN FAILED"
-  )
+IF("${_result_code}" STREQUAL "0")
+  MESSAGE("${TEST}: Diff successful")
 
-CALLBACK(${TEST} ".diff${TEST_SUFFIX}"
-  "Diff successful" "DIFF FAILED"
-  )
+ELSE()
 
+  MESSAGE("***   ***")
+  MESSAGE("${TEST}: Diff failed:")
+  MESSAGE(${_output})
+  MESSAGE("***   ***")
+  MESSAGE(FATAL_ERROR "*** Test aborted.")
+ENDIF()

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.