diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-08-01 17:35:00 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-08-01 17:35:00 (GMT) |
commit | e55844b7523676c381eb22f638369a794021d798 (patch) | |
tree | 9121dc5ee07215bc6389dc8bcf61e96b4040e69f /tools/h5diff | |
parent | 1494413413932f1e640815d109fd1e8386bab3f9 (diff) | |
download | hdf5-e55844b7523676c381eb22f638369a794021d798.zip hdf5-e55844b7523676c381eb22f638369a794021d798.tar.gz hdf5-e55844b7523676c381eb22f638369a794021d798.tar.bz2 |
[svn-r30237] HDFFV-9939: Change cmake commands to reduce POST_BUILD custom commands. Fixes possible overruns on windows command lines.
Diffstat (limited to 'tools/h5diff')
-rw-r--r-- | tools/h5diff/CMakeTests.cmake | 76 |
1 files changed, 28 insertions, 48 deletions
diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 7698cc1..a649b78 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -79,10 +79,6 @@ set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_10.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_100.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_11.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_12.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_13.txt @@ -260,6 +256,13 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v3.txt ) + set (LIST_WIN_TEST_FILES + h5diff_101 + h5diff_102 + h5diff_103 + h5diff_104 + ) + # Make testfiles dir under build dir file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -268,48 +271,25 @@ # foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) - set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #message (STATUS " Copying ${fname}") - add_custom_command ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${h5_tstfiles} ${dest} - ) - endforeach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5diff_files") + endforeach () # # Overwrite system dependent files (Windows) and not VS2015 # if (WIN32 AND MSVC_VERSION LESS 1900) - add_custom_command ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_101.txt - ) - - add_custom_command ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_102.txt - ) - add_custom_command ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_103.txt - ) - - add_custom_command ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_104.txt - ) - endif (WIN32 AND MSVC_VERSION LESS 1900) + foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) + get_filename_component(fname "${h5_tstfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + endforeach () + else () + foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) + get_filename_component(fname "${h5_tstfiles}" NAME) + HDFTEST_COPY_FILE("${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") + endforeach () + endif () + add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list}) ############################################################################## ############################################################################## @@ -324,10 +304,10 @@ set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DIFF-${resultfile}-clear-objects @@ -350,7 +330,7 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) - endif (H5_HAVE_PARALLEL) + endif () ENDMACRO (ADD_H5_TEST file) MACRO (ADD_PH5_TEST resultfile resultcode) @@ -360,10 +340,10 @@ set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT ${resultcode} STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME PH5DIFF-${resultfile}-clear-objects @@ -402,18 +382,18 @@ # if there was a previous test if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () endif (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF-${testname} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) if (NOT ${resultcode} STREQUAL "0") set_tests_properties (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") - endif (NOT ${resultcode} STREQUAL "0") + endif () if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - endif (NOT "${last_test}" STREQUAL "") + endif () else (HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) |