From: maier Date: Sat, 28 Sep 2013 16:29:28 +0000 (+0000) Subject: Revert the last two commits, remove PROCESSORS statement from tests X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15caafa13e6e8101ff471049c4f623c6a1ba2953;p=dealii-svn.git Revert the last two commits, remove PROCESSORS statement from tests This was a afternoon of bad ideas... git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31002 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/cmake/macros/macro_add_test.cmake b/tests/cmake/macros/macro_add_test.cmake index a12bb0f8ed..1faea678c9 100644 --- a/tests/cmake/macros/macro_add_test.cmake +++ b/tests/cmake/macros/macro_add_test.cmake @@ -74,28 +74,26 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file _n_cpu) # # Setup a bunch of variables describing the test: # - STRING(TOLOWER ${_build} _build_lowercase) + SET(_target ${_test_name}.${_build_lowercase}) # target name # If _n_cpu is equal to "0", a normal, sequental test will be run, # otherwise run the test with mpirun: IF("${_n_cpu}" STREQUAL "0") - SET(_target ${_test_name}.${_build_lowercase}) # the target name for the executable - SET(_run_command) # the first part of the command to issue - SET(_processors 1) + + SET(_diff_target ${_target}.diff) # diff target name + SET(_test_full ${_category}/${_test_name}.${_build_lowercase}) # full test name + SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}) # directory to run the test in + SET(_run_command ${_target}) # the command to issue + ELSE() - SET(_target ${_test_name}.mpirun=${_n_cpu}.${_build_lowercase}) # the target name for the executable - SET(_run_command mpirun -np ${_n_cpu}) # the first part of the command to issue - SET(_processors 2) # heuristically... - ENDIF() - SET(_test_full ${_category}/${_target}) # full test name - SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}) # directory to run the test in + SET(_diff_target ${_test_name}.mpirun${_n_cpu}.${_build_lowercase}.diff) # diff target name + SET(_test_full ${_category}/${_test_name}.mpirun=${_n_cpu}.${_build_lowercase}) # full test name + SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}/mpirun=${_n_cpu}) # directory to run the test in + SET(_run_command mpirun -np ${_n_cpu} ${CMAKE_CURRENT_BINARY_DIR}/${_target}/${_target}) # the command to issue - # avoid "=" in target names: - STRING(REGEX REPLACE "=" "" _target "${_target}") - LIST(APPEND _run_command ${_target}) # the second part of the command to issue - SET(_diff_target ${_target}.diff) # diff target name + ENDIF() FILE(MAKE_DIRECTORY ${_test_directory}) @@ -103,24 +101,27 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file _n_cpu) # Add an executable for the current test and set up compile # definitions and the full link interface: # - - ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL ${_test_name}.cc) - - SET_TARGET_PROPERTIES(${_target} PROPERTIES - LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" - COMPILE_DEFINITIONS "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_${_build}}" - COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" - LINKER_LANGUAGE "CXX" - RUNTIME_OUTPUT_DIRECTORY "${_test_directory}" - ) - SET_PROPERTY(TARGET ${_target} APPEND PROPERTY - INCLUDE_DIRECTORIES "${DEAL_II_INCLUDE_DIRS}" - ) - SET_PROPERTY(TARGET ${_target} APPEND PROPERTY - COMPILE_DEFINITIONS - SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" - ) - TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET_${_build}}) + IF(NOT TARGET ${_target}) + # only add the target once + + ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL ${_test_name}.cc) + + SET_TARGET_PROPERTIES(${_target} PROPERTIES + LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" + COMPILE_DEFINITIONS "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_${_build}}" + COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" + LINKER_LANGUAGE "CXX" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_target}" + ) + SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + INCLUDE_DIRECTORIES "${DEAL_II_INCLUDE_DIRS}" + ) + SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + COMPILE_DEFINITIONS + SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" + ) + TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET_${_build}}) + ENDIF() # # Add a top level target to run and compare the test: @@ -187,7 +188,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file _n_cpu) SET_TESTS_PROPERTIES(${_test_full} PROPERTIES LABEL "${_category}" TIMEOUT ${TEST_TIME_LIMIT} - PROCESSORS ${_processors} ) ENDIF() ENDFOREACH()