diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2014-06-17 20:40:01 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2014-06-17 20:40:01 (GMT) |
commit | 611d2c89afa02204e6321849d24aed26878097f0 (patch) | |
tree | 806802afc30a3a212d94b47ad661fd3b8c91a0df /tools | |
parent | 720e0c7623be9847867b9d857329ab626ee8f3e8 (diff) | |
download | hdf5-611d2c89afa02204e6321849d24aed26878097f0.zip hdf5-611d2c89afa02204e6321849d24aed26878097f0.tar.gz hdf5-611d2c89afa02204e6321849d24aed26878097f0.tar.bz2 |
[svn-r25307] Bring revisions #24698 - #24783 from trunk to revise_chunks.
Tested on jam, koala, ostrich, platypus.
Diffstat (limited to 'tools')
26 files changed, 1591 insertions, 1575 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3bb4a1f..0dfe7c9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Setup include Directories @@ -14,9 +14,9 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- -IF (NOT BUILD_TESTING) +if (NOT BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) -ENDIF (NOT BUILD_TESTING) +endif (NOT BUILD_TESTING) #-- Add the h5diff and test executables ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 6faf332..66cbae6 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -9,27 +9,27 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5copy and test executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) +add_executable (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copy " " " ") -TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) +target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5copy PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5copy) +set (H5_DEP_EXECUTABLES h5copy) -IF (BUILD_TESTING) - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) +if (BUILD_TESTING) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copygentest " " " ") - TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) + set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5copy RUNTIME DESTINATION diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index a4cce03..34976fe 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -8,30 +8,30 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles}") + add_custom_command ( TARGET h5copy POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -43,157 +43,157 @@ # Perform h5copy according to passing parmeters # MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY_F-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY_F-${testname} COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY_F-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_F_TEST) MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) + + add_test ( NAME H5COPY-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) + set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST2) MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY_SAME-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY_SAME-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) + + add_test ( NAME H5COPY_SAME-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) + set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST_SAME) # @@ -202,17 +202,17 @@ # MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-CMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -220,7 +220,7 @@ ./testfiles/${testname}.out.out ./testfiles/${testname}.out.out.err ) - ADD_TEST ( + add_test ( NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5copy>" @@ -232,8 +232,8 @@ -D "TEST_MASK=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## @@ -245,14 +245,14 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (HDF_FILE1 h5copytst) - SET (HDF_FILE2 h5copy_ref) - SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) - SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) + set (HDF_FILE1 h5copytst) + set (HDF_FILE2 h5copy_ref) + set (HDF_EXT_SRC_FILE h5copy_extlinks_src) + set (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -291,12 +291,12 @@ h5copy_misc1.out.out h5copy_misc1.out.out.err ) - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5COPY-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index d79c290..f660c12 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -9,45 +9,45 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5diff executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5diff +add_executable (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) TARGET_NAMING (h5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diff " " " ") -TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools) +target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5diff PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5diff) +set (H5_DEP_EXECUTABLES h5diff) -IF (H5_HAVE_PARALLEL) - ADD_EXECUTABLE (ph5diff +if (H5_HAVE_PARALLEL) + add_executable (ph5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) TARGET_NAMING (ph5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5diff " " " ") - TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (ph5diff PROPERTIES FOLDER tools) +endif (H5_HAVE_PARALLEL) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5diff and test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diffgentest " " " ") - TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -61,7 +61,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5diff RUNTIME DESTINATION @@ -70,11 +70,11 @@ INSTALL ( toolsapplications ) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL ( + install ( TARGETS ph5diff RUNTIME DESTINATION @@ -82,4 +82,4 @@ IF (H5_HAVE_PARALLEL) COMPONENT toolsapplications ) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index cac4f84..8bae2ca 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_types.h5 @@ -52,7 +52,7 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ) - SET (LIST_OTHER_TEST_FILES + 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 @@ -239,50 +239,50 @@ # # copy test files from source to build dir # - FOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + 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 ( + 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}) + endforeach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) # # Overwrite system dependent files (Windows) # - IF (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + if (WIN32 AND NOT CYGWIN) + 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 ( + 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 ( + 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 ( + 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 NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -292,22 +292,22 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) - 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") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) + 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") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" @@ -319,31 +319,31 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (H5_HAVE_PARALLEL) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) - ENDIF (H5_HAVE_PARALLEL) + endif (H5_HAVE_PARALLEL) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - 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") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) + 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") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME PH5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err ) - ADD_TEST ( + add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$<TARGET_FILE:ph5diff>" @@ -357,8 +357,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" ) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) # ADD_H5_NO_OUTPUT_TEST @@ -366,30 +366,30 @@ # Don't use this if possible; this may be removed. MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DIFF-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err ) # 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 (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") - - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + 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") + + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_NO_OUTPUT_TEST) ############################################################################## @@ -401,56 +401,56 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (FILE1 h5diff_basic1.h5) - SET (FILE2 h5diff_basic2.h5) - SET (FILE3 h5diff_types.h5) - SET (FILE4 h5diff_dtypes.h5) - SET (FILE5 h5diff_attr1.h5) - SET (FILE6 h5diff_attr2.h5) - SET (FILE7 h5diff_dset1.h5) - SET (FILE8 h5diff_dset2.h5) - SET (FILE9 h5diff_hyper1.h5) - SET (FILE10 h5diff_hyper2.h5) - SET (FILE11 h5diff_empty.h5) - SET (FILE12 h5diff_links.h5) - SET (FILE13 h5diff_softlinks.h5) - SET (FILE14 h5diff_linked_softlink.h5) - SET (FILE15 h5diff_extlink_src.h5) - SET (FILE16 h5diff_extlink_trg.h5) - SET (FILE17 h5diff_ext2softlink_src.h5) - SET (FILE18 h5diff_ext2softlink_trg.h5) - SET (FILE19 h5diff_dset_zero_dim_size1.h5) - SET (FILE20 h5diff_dset_zero_dim_size2.h5) - SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) - SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) - SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) - SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) + set (FILE1 h5diff_basic1.h5) + set (FILE2 h5diff_basic2.h5) + set (FILE3 h5diff_types.h5) + set (FILE4 h5diff_dtypes.h5) + set (FILE5 h5diff_attr1.h5) + set (FILE6 h5diff_attr2.h5) + set (FILE7 h5diff_dset1.h5) + set (FILE8 h5diff_dset2.h5) + set (FILE9 h5diff_hyper1.h5) + set (FILE10 h5diff_hyper2.h5) + set (FILE11 h5diff_empty.h5) + set (FILE12 h5diff_links.h5) + set (FILE13 h5diff_softlinks.h5) + set (FILE14 h5diff_linked_softlink.h5) + set (FILE15 h5diff_extlink_src.h5) + set (FILE16 h5diff_extlink_trg.h5) + set (FILE17 h5diff_ext2softlink_src.h5) + set (FILE18 h5diff_ext2softlink_trg.h5) + set (FILE19 h5diff_dset_zero_dim_size1.h5) + set (FILE20 h5diff_dset_zero_dim_size2.h5) + set (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) + set (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + set (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) + set (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) # group recursive - same structure via external links through files - SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) - SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) - SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) - SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) + set (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) + set (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) + set (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) + set (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) # same structure, same obj name with different value - SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) - SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) + set (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) + set (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) # different structure and obj names - SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) - SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) + set (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) + set (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) # Only one file contains unique objs. Common objs are same. - SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) - SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) + set (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) + set (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) # compound type with multiple vlen string types - SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) + set (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) # container types (array,vlen) with multiple nested compound types - SET (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) - SET (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) + set (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) + set (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) # attrs with verbose option level - SET (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) - SET (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) + set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) + set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DIFF-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -801,12 +801,12 @@ h5diff_90.out h5diff_90.out.err ) - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DIFF-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # ############################################################################ # # Common usage @@ -1074,7 +1074,7 @@ ADD_H5_TEST (h5diff_90 0 -v ${FILE2} ${FILE2}) # 10. read by hyperslab, print indexes #if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then # # skip this test which sometimes hangs in some THG machines -# MESSAGE (STATUS "SKIP -v ${FILE9} ${FILE10}) +# message (STATUS "SKIP -v ${FILE9} ${FILE10}) #else # ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) #fi diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 30ff215..387c4bf 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -9,38 +9,38 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5dump executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5dump +add_executable (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) TARGET_NAMING (h5dump ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dump " " " ") -TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) +target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5dump PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5dump) +set (H5_DEP_EXECUTABLES h5dump) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dumpgentest " " " ") - TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) - INCLUDE (CMakeTestsPBITS.cmake) + include (CMakeTestsPBITS.cmake) - INCLUDE (CMakeTestsXML.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTestsXML.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -54,7 +54,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5dump RUNTIME DESTINATION diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 13c3d41..433faa3 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl @@ -173,7 +173,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/out3.h5import ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl ) - SET (HDF5_REFERENCE_EXP_FILES + set (HDF5_REFERENCE_EXP_FILES tall-6.exp tnoddlfile.exp trawdatafile.exp @@ -183,7 +183,7 @@ twithddl.exp twithddlfile.exp ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.h5 @@ -280,7 +280,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.h5 ) - SET (HDF5_ERROR_REFERENCE_TEST_FILES + set (HDF5_ERROR_REFERENCE_TEST_FILES ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err @@ -312,77 +312,77 @@ # # copy test files from source dir to test dir # - FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + foreach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_h5_file} ${dest} ) - ENDFOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - IF (WIN32 AND NOT CYGWIN) + foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} ) - ENDIF (WIN32 AND NOT CYGWIN) - ENDFOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + endif (WIN32 AND NOT CYGWIN) + endforeach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - FOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + foreach (tst_other_file ${HDF5_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_other_file} ${dest} ) - ENDFOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + endforeach (tst_other_file ${HDF5_REFERENCE_FILES}) - FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_error_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_error_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_error_file} ${dest} ) - ENDFOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + endforeach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) # -------------------------------------------------------------------- # Special file handling # -------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl ) - IF (WIN32 AND NOT CYGWIN) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp ) - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -392,21 +392,21 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-h5dump-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5dump-${testname}.out h5dump-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -417,42 +417,42 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_SKIP_H5_TEST) MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -463,29 +463,29 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}-N.bin ${resultfile}-N.out ${resultfile}-N.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-N-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -496,29 +496,29 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_N file) MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -529,36 +529,36 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + add_test ( NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT file) MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${ddlfile}.txt ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -569,57 +569,57 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + add_test ( NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + add_test ( NAME H5DUMP-${resultfile}-output-cmp-ddl COMMAND ${CMAKE_COMMAND} -E compare_files ${ddlfile}.txt ${ddlfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-output-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ) - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-output-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile} ) - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) - ADD_TEST ( + set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) + add_test ( NAME H5DUMP-output-cmp-${resultfile} COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_EXPORT_TEST file) MACRO (ADD_H5_MASK_TEST resultfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -631,19 +631,19 @@ -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -656,19 +656,19 @@ -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -683,20 +683,20 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${conffile}.out ${conffile}.out.err ${resultfile}.bin ${resultfile}.h5 ) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-IMPORT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -707,14 +707,14 @@ -D "TEST_REFERENCE=${conffile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") - ADD_TEST (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) - ADD_TEST (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") + add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) + set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) + add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) + set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_IMPORT file) ############################################################################## @@ -723,9 +723,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -1052,12 +1052,12 @@ zerodim.out zerodim.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_HELP_TEST(help 0 -h) @@ -1326,38 +1326,38 @@ # filters are defined. # detect whether the encoder is present. - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) - IF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + if (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # data read internal filters ADD_H5_TEST (treadintfilter 0 --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5) - IF (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_SUPPORT) # data read all filters ADD_H5_TEST (treadfilter 0 --enable-error-stack -d all -d szip tfilters.h5) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - ENDIF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + endif (HDF5_ENABLE_SZIP_SUPPORT) + endif (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) @@ -1390,16 +1390,16 @@ # NATIVE default. the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index baa1705..a920198 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -9,7 +9,7 @@ # Packed Bits # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory - SET (HDF5_REFERENCE_PBITS + set (HDF5_REFERENCE_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl @@ -64,12 +64,12 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl ) - SET (HDF5_REFERENCE_TEST_PBITS + set (HDF5_REFERENCE_TEST_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 ) - SET (HDF5_ERROR_REFERENCE_PBITS + set (HDF5_ERROR_REFERENCE_PBITS ${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err @@ -85,42 +85,42 @@ ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err ) - FOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) GET_FILENAME_COMPONENT(fname "${pbits_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${pbits_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${pbits_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${pbits_h5_file} ${dest} ) - ENDFOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) - FOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) - FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) ############################################################################## ############################################################################## @@ -130,23 +130,23 @@ MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_pbits_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) - ENDIF (NOT "${last_pbits_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_pbits_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) + endif (NOT "${last_pbits_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -157,8 +157,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_PBITS_TEST file) ############################################################################## @@ -167,9 +167,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP_PACKED_BITS-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -280,12 +280,12 @@ tpbitsUnsignedLongLong16.out tpbitsUnsignedLongLong16.out.err ) - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT "${last_pbits_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) - ENDIF (NOT "${last_pbits_test}" STREQUAL "") - SET (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + if (NOT "${last_pbits_test}" STREQUAL "") + set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) + endif (NOT "${last_pbits_test}" STREQUAL "") + set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test failure handling # Missing file name diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 6c9cae1..ffc1cae 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -8,7 +8,7 @@ # # copy XML test files from source dir to test dir # - SET (HDF5_XML_REFERENCE_TEST_FILES + set (HDF5_XML_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5 @@ -61,7 +61,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5 ) - SET (HDF5_XML_REFERENCE_FILES + set (HDF5_XML_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5.xml @@ -127,29 +127,29 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5.xml ) - FOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} ) - ENDFOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) - FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_other_file} ${dest} ) - ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) ############################################################################## ############################################################################## @@ -158,36 +158,36 @@ ############################################################################## MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_XML_SKIP_H5_TEST) MACRO (ADD_XML_H5_TEST resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_xml_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) - ENDIF (NOT "${last_xml_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN}) + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_xml_test}" STREQUAL "") + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) + endif (NOT "${last_xml_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-XML-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - ADD_TEST ( + set_tests_properties (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + add_test ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -198,8 +198,8 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_XML_H5_TEST file) ############################################################################## @@ -208,9 +208,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP-XML-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -343,12 +343,12 @@ tvlstr.h5.out tvlstr.h5.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT "${last_xml_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) - ENDIF (NOT "${last_xml_test}" STREQUAL "") - SET (last_test "H5DUMP-XML-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + if (NOT "${last_xml_test}" STREQUAL "") + set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) + endif (NOT "${last_xml_test}" STREQUAL "") + set (last_test "H5DUMP-XML-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) @@ -413,10 +413,10 @@ # The lone colon here confuses some systems (Cray X1). Skip # it if configure detects that this is a problem. - SET (TESTTYPE "TEST") - IF (NOT "H5_LONE_COLON") - SET (TESTTYPE "SKIP") - ENDIF (NOT "H5_LONE_COLON") + set (TESTTYPE "TEST") + if (NOT "H5_LONE_COLON") + set (TESTTYPE "SKIP") + endif (NOT "H5_LONE_COLON") ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5) ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5) diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index d55bf43..9cf7d5b 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -645,6 +645,7 @@ xml_escape_the_name(const char *str) const char *cp; char *ncp; char *rcp; + size_t ncp_len; if (!str) return NULL; @@ -654,21 +655,16 @@ xml_escape_the_name(const char *str) extra = 0; for (i = 0; i < len; i++) { - if (*cp == '\"') { + if (*cp == '\"') extra += (HDstrlen(quote) - 1); - } - else if (*cp == '\'') { + else if (*cp == '\'') extra += (HDstrlen(apos) - 1); - } - else if (*cp == '<') { + else if (*cp == '<') extra += (HDstrlen(lt) - 1); - } - else if (*cp == '>') { + else if (*cp == '>') extra += (HDstrlen(gt) - 1); - } - else if (*cp == '&') { + else if (*cp == '&') extra += (HDstrlen(amp) - 1); - } cp++; } @@ -677,40 +673,43 @@ xml_escape_the_name(const char *str) return HDstrdup(str); cp = str; - rcp = ncp = (char *)HDmalloc(len + extra + 1); + ncp_len = len + extra + 1; + rcp = ncp = (char *)HDmalloc(ncp_len); if (!ncp) return NULL; /* ?? */ for (i = 0; i < len; i++) { + size_t esc_len; + + HDassert(ncp_len); if (*cp == '\'') { - HDstrncpy(ncp, apos, HDstrlen(apos)); - ncp += HDstrlen(apos); - cp++; + HDstrncpy(ncp, apos, ncp_len); + esc_len = HDstrlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, HDstrlen(lt)); - ncp += HDstrlen(lt); - cp++; + HDstrncpy(ncp, lt, ncp_len); + esc_len = HDstrlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, HDstrlen(gt)); - ncp += HDstrlen(gt); - cp++; + HDstrncpy(ncp, gt, ncp_len); + esc_len = HDstrlen(gt); } else if (*cp == '\"') { - HDstrncpy(ncp, quote, HDstrlen(quote)); - ncp += HDstrlen(quote); - cp++; + HDstrncpy(ncp, quote, ncp_len); + esc_len = HDstrlen(quote); } else if (*cp == '&') { - HDstrncpy(ncp, amp, HDstrlen(amp)); - ncp += HDstrlen(amp); - cp++; + HDstrncpy(ncp, amp, ncp_len); + esc_len = HDstrlen(amp); } else { - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } + ncp += esc_len; + ncp_len -= esc_len; + cp++; } *ncp = '\0'; @@ -740,6 +739,7 @@ xml_escape_the_string(const char *str, int slen) const char *cp; char *ncp; char *rcp; + size_t ncp_len; if (!str) return NULL; @@ -754,65 +754,65 @@ xml_escape_the_string(const char *str, int slen) extra = 0; for (i = 0; i < len; i++) { - if (*cp == '\\') { + if (*cp == '\\') extra++; - } - else if (*cp == '\"') { + else if (*cp == '\"') extra++; - } - else if (*cp == '\'') { + else if (*cp == '\'') extra += (HDstrlen(apos) - 1); - } - else if (*cp == '<') { + else if (*cp == '<') extra += (HDstrlen(lt) - 1); - } - else if (*cp == '>') { + else if (*cp == '>') extra += (HDstrlen(gt) - 1); - } - else if (*cp == '&') { + else if (*cp == '&') extra += (HDstrlen(amp) - 1); - } cp++; } cp = str; - rcp = ncp = (char *) HDcalloc((len + extra + 1), sizeof(char)); + ncp_len = len + extra + 1; + rcp = ncp = (char *) HDcalloc(ncp_len, sizeof(char)); if (ncp == NULL) return NULL; /* ?? */ for (i = 0; i < len; i++) { + size_t esc_len; + + HDassert(ncp_len); if (*cp == '\\') { *ncp++ = '\\'; - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } else if (*cp == '\"') { *ncp++ = '\\'; - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } else if (*cp == '\'') { - HDstrncpy(ncp, apos, HDstrlen(apos)); - ncp += HDstrlen(apos); - cp++; + HDstrncpy(ncp, apos, ncp_len); + esc_len = HDstrlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, HDstrlen(lt)); - ncp += HDstrlen(lt); - cp++; + HDstrncpy(ncp, lt, ncp_len); + esc_len = HDstrlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, HDstrlen(gt)); - ncp += HDstrlen(gt); - cp++; + HDstrncpy(ncp, gt, ncp_len); + esc_len = HDstrlen(gt); } else if (*cp == '&') { - HDstrncpy(ncp, amp, HDstrlen(amp)); - ncp += HDstrlen(amp); - cp++; + HDstrncpy(ncp, amp, ncp_len); + esc_len = HDstrlen(amp); } else { - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } + ncp += esc_len; + ncp_len -= esc_len; + cp++; } *ncp = '\0'; diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 7caf44a..32dff55 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -9,28 +9,28 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) +add_executable (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) TARGET_C_PROPERTIES (h5import " " " ") -TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -#SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) -SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) +target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) +set_target_properties (h5import PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5import) +set (H5_DEP_EXECUTABLES h5import) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) + add_executable (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) TARGET_NAMING (h5importtest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5importtest " " " ") - TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) + target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5importtest PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -44,7 +44,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5import RUNTIME DESTINATION diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 96cca87..2adbdde 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_CONF_FILES + set (HDF5_REFERENCE_CONF_FILES binfp64.conf binin8.conf binin8w.conf @@ -23,7 +23,7 @@ textpfe.conf txtstr.conf ) - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES txtfp32.txt txtfp64.txt txtuin16.txt @@ -42,7 +42,7 @@ dbinuin32.h5.txt dtxtstr.h5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES binfp64.h5 binin8.h5 binin8w.h5 @@ -62,38 +62,38 @@ ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") - #MESSAGE (STATUS " Copying ${conf_file}") - ADD_CUSTOM_COMMAND ( + foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") + #message (STATUS " Copying ${conf_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file} ${dest} ) - ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) + endforeach (conf_file ${HDF5_REFERENCE_CONF_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -102,13 +102,13 @@ ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -118,12 +118,12 @@ ${testfile}.out ${testfile}.out.err ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) + add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) + set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) - ADD_TEST ( + add_test ( NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -135,8 +135,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) - ADD_TEST ( + set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) + add_test ( NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -148,14 +148,14 @@ -D "TEST_REFERENCE=${testfile}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) MACRO (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5IMPORT-DUMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -168,10 +168,10 @@ d${testfile}.dff d${testfile}.dff.err ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - IF ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( + if ("${ARGN}" STREQUAL "BINARY") + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -182,8 +182,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ELSE ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( + else ("${ARGN}" STREQUAL "BINARY") + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -194,10 +194,10 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF ("${ARGN}" STREQUAL "BINARY") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + endif ("${ARGN}" STREQUAL "BINARY") + set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5import>" @@ -208,9 +208,9 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") + set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" @@ -222,25 +222,25 @@ -D "TEST_REFERENCE=testfiles/d${testfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) # -------------------------------------------------------------------- # Determine if filter is available for h5diff # -------------------------------------------------------------------- - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) ############################################################################## ############################################################################## @@ -248,9 +248,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5IMPORT-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -406,10 +406,10 @@ dtxtstr.h5.dff dtxtstr.h5.dff.err ) - SET (last_test "H5IMPORT-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set (last_test "H5IMPORT-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5IMPORT-h5importtest-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -421,13 +421,13 @@ binuin16.bin binuin32.bin ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-clear-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5IMPORT-clear-objects") - ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) + add_test (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) + set_tests_properties (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) # ----- TESTING "ASCII I32 rank 3 - Output BE " ; ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) @@ -452,19 +452,19 @@ # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 49d1b0c..b12544f 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -9,54 +9,54 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5jam executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) +add_executable (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) TARGET_NAMING (h5jam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5jam " " " ") -TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools) +target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5jam PROPERTIES FOLDER tools) -ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) +add_executable (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub ${LIB_TYPE}) TARGET_C_PROPERTIES (getub " " " ") -TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools) +target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (getub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) +add_executable (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) TARGET_NAMING (tellub ${LIB_TYPE}) TARGET_C_PROPERTIES (tellub " " " ") -TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools) +target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (tellub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) +add_executable (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) TARGET_NAMING (h5unjam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5unjam " " " ") -TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools) +target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5unjam PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5jam getub tellub h5unjam ) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5jam test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (testhdf5 " " " ") - TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -70,7 +70,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5jam h5unjam RUNTIME DESTINATION diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 3816e85..4b71d7f 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES u10.txt u511.txt u512.txt @@ -14,34 +14,34 @@ h5unjam-help.txt h5jam-ub-nohdf5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES tall.h5 twithub.h5 twithub513.h5 ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) ############################################################################## ############################################################################## @@ -55,20 +55,20 @@ # MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${expectfile}.out ${expectfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5jam>" @@ -79,8 +79,8 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5JAM_OUTPUT) # ============================================================ @@ -89,20 +89,20 @@ # MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-UNJAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${expectfile}.out ${expectfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" @@ -113,14 +113,14 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5UNJAM_OUTPUT) MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}-CHECKFILE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -129,8 +129,8 @@ ${actual}.out ${actual}.out.err ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -142,8 +142,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -155,43 +155,43 @@ -D "TEST_REFERENCE=${actual}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(CHECKFILE testname testdepends expected actual) MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${infile} ) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}-UNJAM-SETUP COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${setfile} ${PROJECT_BINARY_DIR}/${infile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) + add_test ( NAME H5JAM-${testname}-UNJAM-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) - IF (NOT "${ufile}" STREQUAL "NONE") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) + if (NOT "${ufile}" STREQUAL "NONE") + add_test ( NAME H5JAM-${testname}-UNJAM_D-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${ufile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test ${ufile}) - ELSE (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile}) + set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + set (compare_test ${ufile}) + else (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${ARGN}" STREQUAL "--delete") + add_test ( NAME H5JAM-${testname}-UNJAM_D-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + add_test ( NAME H5JAM-${testname}-UNJAM COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" @@ -202,16 +202,16 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test "${outfile}.ufile.txt") - ELSE (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - SET (compare_test "") - ENDIF (NOT "${ARGN}" STREQUAL "--delete") - ENDIF (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${compare_test}" STREQUAL "") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + set (compare_test "${outfile}.ufile.txt") + else (NOT "${ARGN}" STREQUAL "--delete") + add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile}) + set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + set (compare_test "") + endif (NOT "${ARGN}" STREQUAL "--delete") + endif (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${compare_test}" STREQUAL "") + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -219,8 +219,8 @@ ${infile}.cmp ${infile}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -233,10 +233,10 @@ -D "TEST_OFILE=" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) - ENDIF (NOT "${compare_test}" STREQUAL "") + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) + endif (NOT "${compare_test}" STREQUAL "") - ADD_TEST ( + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -249,33 +249,33 @@ -D "TEST_OFILE=NULL" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - IF (NOT "${compare_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) - ELSE (NOT "${compare_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - ENDIF (NOT "${compare_test}" STREQUAL "") + if (NOT "${compare_test}" STREQUAL "") + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) + else (NOT "${compare_test}" STREQUAL "") + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) + endif (NOT "${compare_test}" STREQUAL "") CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(UNJAMTEST testname infile ufile outfile) MACRO (JAMTEST testname jamfile infile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) - SET (compare_test ${outfile}) - SET (compare_orig testfiles/${infile}) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") - - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) + set (compare_test ${outfile}) + set (compare_orig testfiles/${infile}) + if ("${ARGN}" STREQUAL "--clobber") + set (compare_orig "") + endif ("${ARGN}" STREQUAL "--clobber") + + add_test ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -283,8 +283,8 @@ ${compare_test}.cmp ${compare_test}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") + add_test ( NAME H5JAM-${testname}-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -297,40 +297,40 @@ -D "TEST_OFILE=${compare_orig}" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) + set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST testname jamfile infile outfile) MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}_NONE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${chkfile} ${chkfile}.cpy.h5 ) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE-SETUP COMMAND ${CMAKE_COMMAND} -E copy_if_different testfiles/${setfile} ${chkfile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) + set_tests_properties (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE_COPY COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5 ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) + set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) - ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) + add_test (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) - SET (compare_test ${chkfile}) - SET (compare_orig ${chkfile}.cpy.h5) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") + set (compare_test ${chkfile}) + set (compare_orig ${chkfile}.cpy.h5) + if ("${ARGN}" STREQUAL "--clobber") + set (compare_orig "") + endif ("${ARGN}" STREQUAL "--clobber") - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -338,8 +338,8 @@ ${compare_test}.cmp ${compare_test}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") + add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -352,9 +352,9 @@ -D "TEST_OFILE=${compare_orig}" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) + set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) ############################################################################## diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index eeaf1ea..b351268 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -9,21 +9,21 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #----------------------------------------------------------------------------- # Add the h5ls executable #----------------------------------------------------------------------------- -ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) +add_executable (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) TARGET_NAMING (h5ls ${LIB_TYPE}) TARGET_C_PROPERTIES (h5ls " " " ") -TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools) +target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5ls PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5ls ) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -37,7 +37,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5ls RUNTIME DESTINATION diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 09f375d..eb68d79 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the test files from source directory to test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 @@ -33,7 +33,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls @@ -95,17 +95,17 @@ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy the list of test files - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles} to ${dest}") + add_custom_command ( TARGET h5ls POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## @@ -116,22 +116,22 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) + set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5LS-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" @@ -142,8 +142,8 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -152,9 +152,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5LS-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -265,11 +265,11 @@ tvldtypes2be.out tvldtypes2be.out.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5LS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -378,25 +378,25 @@ # test for attribute with region references wo verbose mode # ( HDFFV-7838, ) - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) # test for variable length data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for dataset region references data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 176fc2b..4625607 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -10,7 +10,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- # Add h5Repack executables # -------------------------------------------------------------------- -SET (REPACK_COMMON_SRCS +set (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_copy.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_filters.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_opttable.c @@ -20,43 +20,43 @@ SET (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack.c ) -ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) +add_executable (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) TARGET_NAMING (h5repack ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repack " " " ") -TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) +target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5repack PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5repack) +set (H5_DEP_EXECUTABLES h5repack) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add h5Repack test executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) + add_executable (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ") - TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools) + target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) - ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) + add_executable (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) TARGET_NAMING (h5repacktest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repacktest " " " ") - TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) + target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5repacktest PROPERTIES FOLDER tools) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- - IF (BUILD_SHARED_LIBS) - SET (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - SET (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - SET (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + if (BUILD_SHARED_LIBS) + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} ${LIB_TYPE} @@ -69,7 +69,7 @@ IF (BUILD_TESTING) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -77,11 +77,11 @@ IF (BUILD_TESTING) "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" ) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -95,7 +95,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5repack RUNTIME DESTINATION diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 95288f0..430defc 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -5,8 +5,8 @@ ############################################################################## ############################################################################## - IF (HDF5_TEST_VFD) - SET (VFD_LIST + if (HDF5_TEST_VFD) + set (VFD_LIST sec2 stdio core @@ -15,12 +15,12 @@ family ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - ADD_TEST ( + add_test ( NAME H5REPACK-VFD-${vfdname}-h5repacktest COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>" @@ -31,17 +31,17 @@ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") ENDMACRO (ADD_VFD_TEST) - ENDIF (HDF5_TEST_VFD) + endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 @@ -79,7 +79,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack-help.txt ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin @@ -93,17 +93,17 @@ ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5.tst ) - FOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repack POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${h5_file} ${dest} ) - ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -113,21 +113,21 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN}) - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN}) + set_tests_properties (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK-h5repack-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5repack-${testname}.out h5repack-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ADD_TEST ( + set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" @@ -138,74 +138,74 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_H5_TEST_OLD testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_OLD-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") + add_test ( NAME H5REPACK_OLD-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK_OLD-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST_OLD) MACRO (ADD_H5_TEST testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") + add_test ( NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_CMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_CMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" @@ -217,31 +217,31 @@ -D "TEST_REFERENCE=${resultfile}.tst" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (${testtype} STREQUAL "SKIP") + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_CMP_TEST) MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_DMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts - ADD_TEST ( + add_test ( NAME H5REPACK_DMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -252,35 +252,35 @@ -D "TEST_REFERENCE=${testname}.${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_DMP_TEST) MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - IF (${resultcode} STREQUAL "0") - ADD_TEST ( + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) + if (${resultcode} STREQUAL "0") + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -292,18 +292,18 @@ -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ELSE (${resultcode} STREQUAL "0") - IF (${testfilter} STREQUAL "CHUNKED") - SET (nottestfilter "(CONTIGUOUS|COMPACT)") - ENDIF (${testfilter} STREQUAL "CHUNKED") - IF (${testfilter} STREQUAL "CONTIGUOUS") - SET (nottestfilter "(CHUNK|COMPACT)") - ENDIF (${testfilter} STREQUAL "CONTIGUOUS") - IF (${testfilter} STREQUAL "COMPACT") - SET (nottestfilter "(CONTIGUOUS|CHUNK)") - ENDIF (${testfilter} STREQUAL "COMPACT") - ADD_TEST ( + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + else (${resultcode} STREQUAL "0") + if (${testfilter} STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") + endif (${testfilter} STREQUAL "CHUNKED") + if (${testfilter} STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif (${testfilter} STREQUAL "CONTIGUOUS") + if (${testfilter} STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") + endif (${testfilter} STREQUAL "COMPACT") + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -315,35 +315,35 @@ -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ENDIF (${resultcode} STREQUAL "0") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + endif (${resultcode} STREQUAL "0") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_VERIFY_TEST) MACRO (ADD_H5_TEST_META testname testfile) - ADD_TEST ( + add_test ( NAME H5REPACK_META-${testname}_N COMMAND $<TARGET_FILE:h5repack> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK_META-${testname}_M COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) - SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) + set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) - ADD_TEST (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) - SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") - SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) + add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) + set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) ENDMACRO (ADD_H5_TEST_META) MACRO (ADD_H5_UD_TEST testname resultcode resultfile) - IF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPACK_UD-${testname}-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -353,7 +353,7 @@ testfiles/${resultfile}-${testname}.out testfiles/${resultfile}-${testname}.out.err ) - ADD_TEST ( + add_test ( NAME H5REPACK_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" @@ -367,8 +367,8 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) - ADD_TEST ( + set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) + add_test ( NAME H5REPACK_UD-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -381,8 +381,8 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") - ENDIF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") + endif (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_UD_TEST) ############################################################################## @@ -394,30 +394,30 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (INFO_FILE testfiles/h5repack.info) - - SET (FILE0 h5repack_fill.h5) - SET (FILE1 h5repack_objs.h5) - SET (FILE2 h5repack_attr.h5) - SET (FILE3 h5repack_hlink.h5) - SET (FILE4 h5repack_layout.h5) - SET (FILE5 h5repack_early.h5) - SET (FILE7 h5repack_szip.h5) - SET (FILE8 h5repack_deflate.h5) - SET (FILE9 h5repack_shuffle.h5) - SET (FILE10 h5repack_fletcher.h5) - SET (FILE11 h5repack_filters.h5) - SET (FILE12 h5repack_nbit.h5) - SET (FILE13 h5repack_soffset.h5) - SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) - SET (FILE15 h5repack_named_dtypes.h5) - SET (FILE16 tfamily%05d.h5) # located in common testfiles folder - SET (FILE18 h5repack_layout2.h5) - SET (FILE_REF h5repack_refs.h5) - SET (FILE_ATTR_REF h5repack_attr_refs.h5) + set (INFO_FILE testfiles/h5repack.info) + + set (FILE0 h5repack_fill.h5) + set (FILE1 h5repack_objs.h5) + set (FILE2 h5repack_attr.h5) + set (FILE3 h5repack_hlink.h5) + set (FILE4 h5repack_layout.h5) + set (FILE5 h5repack_early.h5) + set (FILE7 h5repack_szip.h5) + set (FILE8 h5repack_deflate.h5) + set (FILE9 h5repack_shuffle.h5) + set (FILE10 h5repack_fletcher.h5) + set (FILE11 h5repack_filters.h5) + set (FILE12 h5repack_nbit.h5) + set (FILE13 h5repack_soffset.h5) + set (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) + set (FILE15 h5repack_named_dtypes.h5) + set (FILE16 tfamily%05d.h5) # located in common testfiles folder + set (FILE18 h5repack_layout2.h5) + set (FILE_REF h5repack_refs.h5) + set (FILE_ATTR_REF h5repack_attr_refs.h5) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPACK-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -597,30 +597,30 @@ h5repack_ext.bin ublock.bin ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") ADD_HELP_TEST(help 0 -h) - ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) - IF (HDF5_ENABLE_SZIP_SUPPORT) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "yes") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - ELSE (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - ELSE (HDF5_ENABLE_SZIP_SUPPORT) - SET (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) - - ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) - SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) - SET (last_test "H5REPACK-h5repacktest") + add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) + if (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "yes") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") + else (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "no") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + endif (HDF5_ENABLE_SZIP_ENCODING) + else (HDF5_ENABLE_SZIP_SUPPORT) + set (passRegex "no") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + endif (HDF5_ENABLE_SZIP_SUPPORT) + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) + + add_test (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) + set_tests_properties (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) + set (last_test "H5REPACK-h5repacktest") # # The tests @@ -636,34 +636,34 @@ # filters are defined. # detect whether the encoder is present. - SET (USE_FILTER_SZIP_ENCODER "no") - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) - - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) - - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) - - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) - - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) - - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SZIP_ENCODER "no") + if (HDF5_ENABLE_SZIP_ENCODING) + set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) + endif (HDF5_ENABLE_SZIP_ENCODING) + + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) + + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) + + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) + + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) + + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) # copy files (these files have no filters) ADD_H5_TEST (fill "TEST" ${FILE0}) @@ -676,83 +676,83 @@ # use $FILE4 to write some filters (this file has no filters) # gzip with individual object - SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all - SET (arg ${FILE4} -f GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object - SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all - SET (arg ${FILE4} -f SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object - SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) # shuffle for all - SET (arg ${FILE4} -f SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) # fletcher32 with individual object - SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) # fletcher32 for all - SET (arg ${FILE4} -f FLET) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f FLET) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) # all filters - SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object - SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE11} -v -f /dset_deflate:GZIP=9) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### @@ -760,154 +760,154 @@ ########################################################### # szip copy - SET (arg ${FILE7}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove - SET (arg ${FILE7} --filter=dset_szip:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7} --filter=dset_szip:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy - SET (arg ${FILE8}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove - SET (arg ${FILE8} -f dset_deflate:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy - SET (arg ${FILE9}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) # shuffle remove - SET (arg ${FILE9} -f dset_shuffle:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9} -f dset_shuffle:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) # fletcher32 copy - SET (arg ${FILE10}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) # fletcher32 remove - SET (arg ${FILE10} -f dset_fletcher32:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10} -f dset_fletcher32:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) # nbit copy - SET (arg ${FILE12}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) # nbit remove - SET (arg ${FILE12} -f dset_nbit:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_nbit:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) # nbit add - SET (arg ${FILE12} -f dset_int31:NBIT) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_int31:NBIT) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) # scaleoffset copy - SET (arg ${FILE13}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) # scaleoffset add - SET (arg ${FILE13} -f dset_none:SOFF=31,IN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_none:SOFF=31,IN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) # scaleoffset remove - SET (arg ${FILE13} -f dset_scaleoffset:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_scaleoffset:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) # remove all filters - SET (arg ${FILE11} -f NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE11} -f NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions - SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) - SET (arg ${FILE7} -f dset_szip:GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE7} -f dset_szip:GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit - SET (arg ${FILE4} -f GZIP=1 -m 1024) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1 -m 1024) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_DMP_TEST (deflate_limit ${TESTTYPE} 0 ${arg}) #file - SET (arg ${FILE4} -e ${INFO_FILE}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -e ${INFO_FILE}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### @@ -990,44 +990,44 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters - SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} --filter GZIP=1 --filter SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "LEGACY") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + set (TESTTYPE "LEGACY") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file - SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) + set (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) ADD_H5_TEST (add_userblock "TEST" ${arg}) # add alignment - SET (arg ${FILE1} -t 1 -a 1) + set (arg ${FILE1} -t 1 -a 1) ADD_H5_TEST (add_alignment "TEST" ${arg}) # Check repacking file with old version of layout message (should get upgraded @@ -1064,20 +1064,20 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) -# ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) -ELSE (BUILD_SHARED_LIBS) - MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") - ADD_TEST ( + ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) +else (BUILD_SHARED_LIBS) + message (STATUS " **** Plugins libraries must be built as shared libraries **** ") + add_test ( NAME H5REPACK-plugin COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) -ENDIF (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS) - IF (HDF5_TEST_VFD) + if (HDF5_TEST_VFD) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) - ENDIF (HDF5_TEST_VFD) + endforeach (vfd ${VFD_LIST}) + endif (HDF5_TEST_VFD) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 6086fc2..d182a45 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -9,30 +9,30 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5stat executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) +add_executable (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) TARGET_NAMING (h5stat ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat " " " ") -TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) +target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5stat PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5stat) +set (H5_DEP_EXECUTABLES h5stat) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5stat test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat_gentest " " " ") - TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) + set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -46,7 +46,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5stat RUNTIME DESTINATION diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 81ddf82..b803dff 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES h5stat_help1.ddl h5stat_help2.ddl h5stat_notexist.ddl @@ -41,34 +41,34 @@ h5stat_numattrs3.ddl h5stat_numattrs4.ddl ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES h5stat_filters.h5 h5stat_tsohm.h5 h5stat_newgrat.h5 h5stat_threshold.h5 ) - FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) - SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Translating ${ddl_file}") - ADD_CUSTOM_COMMAND ( + foreach (ddl_file ${HDF5_REFERENCE_FILES}) + set (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #message (STATUS " Translating ${ddl_file}") + add_custom_command ( TARGET h5stat POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} ) - ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + endforeach (ddl_file ${HDF5_REFERENCE_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5stat POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -78,21 +78,21 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN}) + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5STAT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>" @@ -103,8 +103,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -113,9 +113,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5STAT-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -182,11 +182,11 @@ h5stat_numattrs4.out h5stat_numattrs4.out.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5STAT-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 43ef6ba..5569b6f 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -4,13 +4,13 @@ PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (H5_TOOLS_LIB_SRCS +set (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_array.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_attr.c @@ -26,7 +26,7 @@ SET (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.c ) -SET (H5_TOOLS_LIB_HDRS +set (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h @@ -36,18 +36,18 @@ SET (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h ) -ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +add_library (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} HDF5_TOOLS_LIB_NAME_RELEASE HDF5_TOOLS_LIB_NAME_DEBUG ) -#SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) -SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) +#set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) +set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## @@ -58,7 +58,7 @@ SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tool #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${H5_TOOLS_LIB_HDRS} DESTINATION @@ -71,26 +71,26 @@ INSTALL ( # Because tools are installed into bin/tools we need to make sure the hdf5tools # library will be installed into the proper location. #----------------------------------------------------------------------------- -IF (APPLE) - OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) - IF (HDF5_BUILD_WITH_INSTALL_NAME) +if (APPLE) + option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + if (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${HDF5_TOOLS_LIB_TARGET} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) -ENDIF (APPLE) + endif (HDF5_BUILD_WITH_INSTALL_NAME) +endif (APPLE) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_TOOLS_LIB_TARGET} EXPORT @@ -99,4 +99,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolslibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 2da21ef..3664a29 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,10 +20,10 @@ * print a warning message *------------------------------------------------------------------------- */ -static void print_warning(const char *dname, const char *fname) -{ - fprintf(stderr,"warning: dataset <%s> cannot be read, %s filter is not available\n", - dname,fname); +static void print_warning(const char *dname, const char *fname) { + fprintf(stderr, + "warning: dataset <%s> cannot be read, %s filter is not available\n", + dname, fname); } /*------------------------------------------------------------------------- @@ -46,109 +46,111 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr hid_t dcpl_id) /* dataset creation property list */ { - int nfilters; /* number of filters */ - H5Z_filter_t filtn; /* filter identification number */ - int i; /* index */ - - - /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) - return -1; - - /* if we do not have filters, we can read the dataset safely */ - if (!nfilters) - return 1; - - /* check availability of filters */ - for(i = 0; i < nfilters; i++) - { - if((filtn = H5Pget_filter2(dcpl_id, (unsigned)i, 0, 0, 0, (size_t)0, 0, NULL)) < 0) - return -1; - - switch(filtn) - { -/*------------------------------------------------------------------------- - * user defined filter - *------------------------------------------------------------------------- - */ - default: - if(name) - print_warning(name, "user defined"); - return 0; - -/*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_DEFLATE: + int nfilters; /* number of filters */ + H5Z_filter_t filtn; /* filter identification number */ + int i; /* index */ + int udfilter_avail; /* index */ + + /* get information about filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) + return -1; + + /* if we do not have filters, we can read the dataset safely */ + if (!nfilters) + return 1; + + /* check availability of filters */ + for (i = 0; i < nfilters; i++) { + if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) + return -1; + + switch (filtn) { + /*------------------------------------------------------------------------- + * user defined filter + *------------------------------------------------------------------------- + */ + default: + if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) + return -1; + else if (udfilter_avail == 0) { + if (name) + print_warning(name, "user defined"); + return 0; + } + break; + + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - if (name) - print_warning(name,"deflate"); - return 0; + if (name) + print_warning(name,"deflate"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP 4 , szip compression - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SZIP: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP 4 , szip compression + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - if (name) - print_warning(name,"SZIP"); - return 0; + if (name) + print_warning(name,"SZIP"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SHUFFLE: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SHUFFLE: #ifndef H5_HAVE_FILTER_SHUFFLE - if (name) - print_warning(name,"shuffle"); - return 0; + if (name) + print_warning(name,"shuffle"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_FLETCHER32: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_FLETCHER32: #ifndef H5_HAVE_FILTER_FLETCHER32 - if (name) - print_warning(name,"fletcher32"); - return 0; + if (name) + print_warning(name,"fletcher32"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_NBIT - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_NBIT: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_NBIT + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_NBIT: #ifndef H5_HAVE_FILTER_NBIT - if (name) - print_warning(name,"nbit"); - return 0; + if (name) + print_warning(name,"nbit"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SCALEOFFSET: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SCALEOFFSET: #ifndef H5_HAVE_FILTER_SCALEOFFSET - if (name) - print_warning(name,"scaleoffset"); - return 0; + if (name) + print_warning(name,"scaleoffset"); + return 0; #endif - break; - }/*switch*/ - }/*for*/ + break; + }/*switch*/ + }/*for*/ - return 1; + return 1; } - /*------------------------------------------------------------------------- * Function: h5tools_canwritef * @@ -164,71 +166,70 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr * *------------------------------------------------------------------------- */ -int h5tools_can_encode( H5Z_filter_t filtn) -{ - switch (filtn) - { - /* user defined filter */ - default: - return 0; +int h5tools_can_encode(H5Z_filter_t filtn) { + switch (filtn) { + /* user defined filter */ + default: + return 0; - case H5Z_FILTER_DEFLATE: + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - return 0; + return 0; #endif - break; - case H5Z_FILTER_SZIP: + break; + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - return 0; + return 0; #else - { - unsigned int filter_config_flags; - - if(H5Zget_filter_info(filtn, &filter_config_flags)<0) - return -1; - if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { - /* filter present but neither encode nor decode is supported (???) */ - return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - H5Z_FILTER_CONFIG_DECODE_ENABLED) { - /* decoder only: read but not write */ - return 0; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - H5Z_FILTER_CONFIG_ENCODE_ENABLED) { - /* encoder only: write but not read (???) */ - return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) { - return 1; - } - } + { + unsigned int filter_config_flags; + + if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) + return -1; + if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { + /* filter present but neither encode nor decode is supported (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { + /* decoder only: read but not write */ + return 0; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { + /* encoder only: write but not read (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) + == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { + return 1; + } + } #endif - break; - case H5Z_FILTER_SHUFFLE: + break; + case H5Z_FILTER_SHUFFLE: #ifndef H5_HAVE_FILTER_SHUFFLE - return 0; + return 0; #endif - break; - case H5Z_FILTER_FLETCHER32: + break; + case H5Z_FILTER_FLETCHER32: #ifndef H5_HAVE_FILTER_FLETCHER32 - return 0; + return 0; #endif - break; - case H5Z_FILTER_NBIT: + break; + case H5Z_FILTER_NBIT: #ifndef H5_HAVE_FILTER_NBIT - return 0; + return 0; #endif - break; - case H5Z_FILTER_SCALEOFFSET: + break; + case H5Z_FILTER_SCALEOFFSET: #ifndef H5_HAVE_FILTER_SCALEOFFSET - return 0; + return 0; #endif - break; - }/*switch*/ + break; + }/*switch*/ - return 1; + return 1; } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index a475ded..fca3096 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -49,7 +49,9 @@ typedef struct { } trav_print_udata_t; /* format for hsize_t */ +#ifdef H5TRAV_PRINT_SPACE #define HSIZE_T_FORMAT "%" H5_PRINTF_LL_WIDTH "u" +#endif /* H5TRAV_PRINT_SPACE */ /*------------------------------------------------------------------------- * local functions @@ -680,11 +682,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for(i = 0; i < table->nobjs; i++) { /* Check for object name having full path (with leading '/') */ if(HDstrcmp(name, table->objs[i].name) == 0) - return(i); + return((int)i); /* Check for object name without leading '/' */ if(HDstrcmp(name, table->objs[i].name + 1) == 0) - return(i); + return((int)i); /* search also in the list of links */ if(table->objs[i].nlinks) { @@ -693,11 +695,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for ( j=0; j<table->objs[i].nlinks; j++) { /* Check for object name having full path (with leading '/') */ if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) - return(i); + return((int)i); /* Check for object name without leading '/' */ if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) - return(i); + return((int)i); } /* end for */ } /* end if */ } /* end for */ @@ -807,7 +809,7 @@ void trav_table_addflags(unsigned *flags, h5trav_type_t type, trav_table_t *table) { - unsigned int new_obj; + size_t new_obj; if(table->nobjs == table->size) { table->size = MAX(1, table->size * 2); @@ -995,6 +997,8 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, printf(" %-10s %s", "datatype", path); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: printf(" %-10s %s", "unknown object type", path); break; @@ -1005,7 +1009,7 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, /* Finish printing line about object */ printf("\n"); if(trav_verbosity > 0) - H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, path, H5P_DEFAULT); + H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, (void *)path, H5P_DEFAULT); } else /* Print the link's original name */ @@ -1040,7 +1044,8 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); - H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; printf(" %-10s %s -> %s\n", "link", path, targbuf); HDfree(targbuf); } /* end if */ @@ -1051,21 +1056,28 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) case H5L_TYPE_EXTERNAL: if(linfo->u.val_size > 0) { char *targbuf; - const char *filename; - const char *objname; + const char *filename = NULL; + const char *objname = NULL; targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); - H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); - H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname); - printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); HDfree(targbuf); } /* end if */ else printf(" %-10s %s ->\n", "ext link", path); break; + case H5L_TYPE_HARD: + /* Should be handled elsewhere */ + return(-1); + + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: default: printf(" %-10s %s -> ???\n", "unknown type of UD link", path); break; diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 8e1003e..833e7e5 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -10,25 +10,25 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the misc executables # -------------------------------------------------------------------- #-- Misc Executables -ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) +add_executable (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) TARGET_C_PROPERTIES (h5debug " " " ") -TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) +target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5debug PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) +add_executable (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart " " " ") -TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) +target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5repart PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) +add_executable (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) TARGET_C_PROPERTIES (h5mkgrp " " " ") -TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) +target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5mkgrp PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5debug h5repart h5mkgrp @@ -37,31 +37,31 @@ SET (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Generate the h5cc file containing settings needed to compile programs #----------------------------------------------------------------------------- -#IF (NOT WIN32) -# CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) -#ENDIF (NOT WIN32) +#if (NOT WIN32) +# configure_file (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) +#endif (NOT WIN32) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the misc test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_gentest " " " ") - TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) + #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) + add_executable (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_test " " " ") - TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) + target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_test PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -77,7 +77,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) #INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5debug h5repart h5mkgrp RUNTIME DESTINATION diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index cc9c5e2..a935c2b 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES family_file00000.h5 family_file00001.h5 family_file00002.h5 @@ -29,18 +29,18 @@ family_file00017.h5 ) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repart POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (HDF5_MKGRP_TEST_FILES + set (HDF5_MKGRP_TEST_FILES #h5mkgrp_help.txt #h5mkgrp_version h5mkgrp_single.ls @@ -60,24 +60,24 @@ # make test dir FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") - #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") + #message (STATUS " Copying ${h5_mkgrp_file}") + add_custom_command ( TARGET h5mkgrp POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file} ${dest} ) - ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + endforeach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5mkgrp POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt ) - CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) + configure_file (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) ############################################################################## ############################################################################## @@ -86,8 +86,8 @@ ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode resultoption) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5MKGRP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -95,21 +95,21 @@ ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5MKGRP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${resultfile}.h5 ${ARGN} ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) - ADD_TEST ( + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) + add_test ( NAME H5MKGRP-${resultfile}-h5ls COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" @@ -121,15 +121,15 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) MACRO (ADD_H5_CMP resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -137,8 +137,8 @@ ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ADD_TEST ( + set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test ( NAME H5MKGRP_CMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp>" @@ -149,8 +149,8 @@ -D "TEST_REFERENCE=${resultfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## @@ -160,7 +160,7 @@ ############################################################################## # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPART-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -171,33 +171,33 @@ scd_family00003.h5 family_to_sec2.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPART-clearall-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPART-clearall-objects") # repartition family member size to 20,000 bytes. - ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) + add_test (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5) + set_tests_properties (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) # repartition family member size to 5 KB. - ADD_TEST (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart> -m 5k family_file%05d.h5 scd_family%05d.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) + add_test (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart> -m 5k family_file%05d.h5 scd_family%05d.h5) + set_tests_properties (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) # convert family file to sec2 file of 20,000 bytes - ADD_TEST (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) + add_test (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) # test the output files repartitioned above. - ADD_TEST (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) - SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) + add_test (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) + set_tests_properties (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) - SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5MKGRP-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -242,12 +242,12 @@ h5mkgrp_nested_mult_lp.out h5mkgrp_nested_mult_lp.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5MKGRP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5MKGRP-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 02c451b..a320054 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -272,7 +272,10 @@ main(int argc, char *argv[]) HDexit(1); } /* end if */ if(HDstrchr(argv[1], '%')) - H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); + if(H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT) < 0) { + fprintf(stderr, "cannot set file access property list\n"); + HDexit(1); + } if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { HDfprintf(stderr, "cannot open file\n"); HDexit(1); |