From 227aaf094c35baa7395d39a83f2cca3390f9f8ee Mon Sep 17 00:00:00 2001 From: maier Date: Sun, 20 Oct 2013 13:35:01 +0000 Subject: [PATCH] Port mesh_converter tests part II git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31329 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/config/Config.cmake.in | 1 + deal.II/cmake/scripts/CMakeLists.txt | 6 ++++-- deal.II/cmake/scripts/normalize.pl | 4 ++++ deal.II/contrib/mesh_conversion/CMakeLists.txt | 8 ++++++-- deal.II/contrib/parameter_gui/CMakeLists.txt | 4 ++++ deal.II/tests/CMakeLists.txt | 2 +- deal.II/tests/mesh_converter/CMakeLists.txt | 15 +++++++++------ .../tests/mesh_converter/meshes/2d/2d_test.ucd | 2 +- deal.II/tests/mesh_converter/meshes/2d/quad.ucd | 2 +- .../mesh_converter/meshes/3d/CC_cubit_new.ucd | 2 +- .../mesh_converter/meshes/3d/CC_cubit_old.ucd | 2 +- .../mesh_converter/meshes/3d/other_simple.ucd | 2 +- .../mesh_converter/meshes/3d/test_cube_1.ucd | 2 +- .../mesh_converter/meshes/3d/test_cube_pave_1.ucd | 2 +- .../meshes/3d/test_cube_two_materials.ucd | 2 +- 15 files changed, 37 insertions(+), 19 deletions(-) diff --git a/deal.II/cmake/config/Config.cmake.in b/deal.II/cmake/config/Config.cmake.in index 53417f2bdf..8d5cd1a74d 100644 --- a/deal.II/cmake/config/Config.cmake.in +++ b/deal.II/cmake/config/Config.cmake.in @@ -173,6 +173,7 @@ SET(DEAL_II_LIBRARIES "@CONFIG_LIBRARIES@") # IF(DEAL_II_BUILD_DIR) + SET(DEAL_II_EXECUTABLE_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake") SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}BuildTargets.cmake") ELSE() SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake") diff --git a/deal.II/cmake/scripts/CMakeLists.txt b/deal.II/cmake/scripts/CMakeLists.txt index 0032e33aaf..6e000ece9b 100644 --- a/deal.II/cmake/scripts/CMakeLists.txt +++ b/deal.II/cmake/scripts/CMakeLists.txt @@ -22,7 +22,6 @@ IF(NOT CMAKE_CROSSCOMPILING) PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/scripts ) INSTALL(TARGETS expand_instantiations - EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts COMPONENT compat_files ) @@ -94,8 +93,11 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) ) INSTALL(TARGETS make_dependencies report_features - EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts COMPONENT compat_files ) + EXPORT(TARGETS make_dependencies report_features + FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake + APPEND + ) ENDIF() diff --git a/deal.II/cmake/scripts/normalize.pl b/deal.II/cmake/scripts/normalize.pl index 2f08a93153..b29534ec1b 100644 --- a/deal.II/cmake/scripts/normalize.pl +++ b/deal.II/cmake/scripts/normalize.pl @@ -16,6 +16,10 @@ s/JobId.*//; +# Remove Input File Name: + +s/# Input file name:.*//; + # Several date and time strings s/%%Creation Date:.*//; diff --git a/deal.II/contrib/mesh_conversion/CMakeLists.txt b/deal.II/contrib/mesh_conversion/CMakeLists.txt index 72e26ef2c4..f17569af7d 100644 --- a/deal.II/contrib/mesh_conversion/CMakeLists.txt +++ b/deal.II/contrib/mesh_conversion/CMakeLists.txt @@ -32,7 +32,11 @@ IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "") ENDIF() INSTALL(TARGETS mesh_converter_exe - RUNTIME - DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} + RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} COMPONENT mesh_converter ) +EXPORT(TARGETS mesh_converter_exe + FILE + ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake + APPEND + ) diff --git a/deal.II/contrib/parameter_gui/CMakeLists.txt b/deal.II/contrib/parameter_gui/CMakeLists.txt index 7ff3f24f7e..c06c0823dc 100644 --- a/deal.II/contrib/parameter_gui/CMakeLists.txt +++ b/deal.II/contrib/parameter_gui/CMakeLists.txt @@ -59,4 +59,8 @@ INSTALL(TARGETS parameter_gui_exe RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} COMPONENT parameter_gui ) +EXPORT(TARGETS parameter_gui_exe + FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake + APPEND + ) diff --git a/deal.II/tests/CMakeLists.txt b/deal.II/tests/CMakeLists.txt index 6ae3f7be6e..5c8cd37da1 100644 --- a/deal.II/tests/CMakeLists.txt +++ b/deal.II/tests/CMakeLists.txt @@ -64,7 +64,7 @@ ENDFOREACH() # Glob together a list of all subfolders to set up: # FILE(GLOB _categories RELATIVE ${TEST_DIR} ${TEST_DIR}/*) -SET(_categories all-headers build_tests ${_categories}) +SET(_categories all-headers build_tests mesh_converter ${_categories}) # # Define a subproject for every enabled category: diff --git a/deal.II/tests/mesh_converter/CMakeLists.txt b/deal.II/tests/mesh_converter/CMakeLists.txt index 7226a6dcf0..464e2714f4 100644 --- a/deal.II/tests/mesh_converter/CMakeLists.txt +++ b/deal.II/tests/mesh_converter/CMakeLists.txt @@ -17,7 +17,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) PROJECT(testsuite CXX) -INCLUDE(${DEAL_II_TARGET_CONFIG}) +INCLUDE(${DEAL_II_EXECUTABLE_CONFIG}) # # Tests for the mesh_converter executable @@ -25,17 +25,17 @@ INCLUDE(${DEAL_II_TARGET_CONFIG}) SET(_category mesh_converter) -FILE(GLOB _meshes ${CMAKE_CURRENT_SOURCE_DIR}/meshes/?d/*.ucd) +FILE(GLOB _meshes ${CMAKE_CURRENT_SOURCE_DIR}/meshes/?d/*.inp) FOREACH(_full_file ${_meshes}) - GET_FILENAME_COMPONENT(_mesh ${_full_file} NAME) + GET_FILENAME_COMPONENT(_mesh ${_full_file} NAME_WE) SET(_test_full ${_category}/${_mesh}) SET(_target ${_mesh}) SET(_diff_target ${_target}.diff) SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}) # directory to run the test in - STRING(REGEX REPLACE "\\.ucd$" ".inp" _comparison_file ${_full_file}) + STRING(REGEX REPLACE "\\.inp$" ".ucd" _comparison_file ${_full_file}) SET(_dim 3) IF(_full_file MATCHES "meshes/2d") @@ -56,15 +56,18 @@ FOREACH(_full_file ${_meshes}) COMMAND rm -f ${_test_directory}/failing_output COMMAND touch ${_test_directory}/output COMMAND - mesh_converter ${_dim} < ${_full_file} > output + mesh_converter_exe ${_dim} ${_full_file} output || (mv ${_test_directory}/output ${_test_directory}/failing_output && echo "${_test_full}: RUN failed. ------ Result: ${_test_directory}/failing_output" && echo "${_test_full}: RUN failed. ------ Partial output:" && cat ${_test_directory}/failing_output && exit 1) + COMMAND + ${PERL_EXECUTABLE} -pi ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl + ${_test_directory}/output WORKING_DIRECTORY ${_test_directory} - DEPENDS mesh_converter + DEPENDS mesh_converter_exe ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl ) ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/diff COMMAND rm -f ${_test_directory}/failing_diff diff --git a/deal.II/tests/mesh_converter/meshes/2d/2d_test.ucd b/deal.II/tests/mesh_converter/meshes/2d/2d_test.ucd index ce3777ab70..9f67909260 100644 --- a/deal.II/tests/mesh_converter/meshes/2d/2d_test.ucd +++ b/deal.II/tests/mesh_converter/meshes/2d/2d_test.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/2d/2d_test.inp + 133 114 0 0 0 1 -1.00000000e+00 0.00000000e+00 0.00000000e+00 2 -1.00000000e+00 -1.66666700e-01 0.00000000e+00 diff --git a/deal.II/tests/mesh_converter/meshes/2d/quad.ucd b/deal.II/tests/mesh_converter/meshes/2d/quad.ucd index f795dc26f6..e7f13e28f2 100644 --- a/deal.II/tests/mesh_converter/meshes/2d/quad.ucd +++ b/deal.II/tests/mesh_converter/meshes/2d/quad.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/2d/quad.inp + 9 12 0 0 0 1 -1.00000000e+00 1.00000000e+00 0.00000000e+00 2 -1.00000000e+00 0.00000000e+00 0.00000000e+00 diff --git a/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_new.ucd b/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_new.ucd index 9ad647c5c0..bc68a51d6d 100644 --- a/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_new.ucd +++ b/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_new.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/3d/CC_cubit_new.inp + 54 48 0 0 0 1 -5.00000000e-01 -5.00000000e-01 5.00000000e-01 2 -5.00000000e-01 -5.00000000e-01 0.00000000e+00 diff --git a/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_old.ucd b/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_old.ucd index 9ee9cfb671..bc68a51d6d 100644 --- a/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_old.ucd +++ b/deal.II/tests/mesh_converter/meshes/3d/CC_cubit_old.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/3d/CC_cubit_old.inp + 54 48 0 0 0 1 -5.00000000e-01 -5.00000000e-01 5.00000000e-01 2 -5.00000000e-01 -5.00000000e-01 0.00000000e+00 diff --git a/deal.II/tests/mesh_converter/meshes/3d/other_simple.ucd b/deal.II/tests/mesh_converter/meshes/3d/other_simple.ucd index cff408f3af..ea545e612d 100644 --- a/deal.II/tests/mesh_converter/meshes/3d/other_simple.ucd +++ b/deal.II/tests/mesh_converter/meshes/3d/other_simple.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/3d/other_simple.inp + 8 1 0 0 0 1 0.00000000e+00 0.00000000e+00 0.00000000e+00 2 0.00000000e+00 0.00000000e+00 5.00000000e+01 diff --git a/deal.II/tests/mesh_converter/meshes/3d/test_cube_1.ucd b/deal.II/tests/mesh_converter/meshes/3d/test_cube_1.ucd index b2fd6f7eab..5f81d2d6b6 100644 --- a/deal.II/tests/mesh_converter/meshes/3d/test_cube_1.ucd +++ b/deal.II/tests/mesh_converter/meshes/3d/test_cube_1.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/3d/test_cube_1.inp + 8 7 0 0 0 1 -1.00000000e+00 -1.00000000e+00 1.00000000e+00 2 -1.00000000e+00 -1.00000000e+00 -1.00000000e+00 diff --git a/deal.II/tests/mesh_converter/meshes/3d/test_cube_pave_1.ucd b/deal.II/tests/mesh_converter/meshes/3d/test_cube_pave_1.ucd index c30c24f6fb..71be64e634 100644 --- a/deal.II/tests/mesh_converter/meshes/3d/test_cube_pave_1.ucd +++ b/deal.II/tests/mesh_converter/meshes/3d/test_cube_pave_1.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/3d/test_cube_pave_1.inp + 39 48 0 0 0 1 1.00000000e+00 1.00000000e+00 0.00000000e+00 2 5.00000000e-01 1.00000000e+00 0.00000000e+00 diff --git a/deal.II/tests/mesh_converter/meshes/3d/test_cube_two_materials.ucd b/deal.II/tests/mesh_converter/meshes/3d/test_cube_two_materials.ucd index 0a62d16076..a81424856c 100644 --- a/deal.II/tests/mesh_converter/meshes/3d/test_cube_two_materials.ucd +++ b/deal.II/tests/mesh_converter/meshes/3d/test_cube_two_materials.ucd @@ -1,6 +1,6 @@ # FEM Mesh Converter # Mesh type: AVS UCD -# Input file name: meshes/3d/test_cube_two_materials.inp + 27 32 0 0 0 1 -1.00000000e+00 -1.00000000e+00 1.00000000e+00 2 -1.00000000e+00 -1.00000000e+00 0.00000000e+00 -- 2.39.5