summaryrefslogtreecommitdiffstats
path: root/tools/h5copy
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-04-19 15:23:01 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-04-19 15:23:01 (GMT)
commit14d8e1c2b5ecaf2e298984f269094dd5f2bd735f (patch)
treecc250461294a2c9118b10a95d0459d7314fa5e50 /tools/h5copy
parent6ee0e05fb94445551840fcb80b9b1c254c736799 (diff)
downloadhdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.zip
hdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.tar.gz
hdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.tar.bz2
[svn-r23600] Bring revisions #23085 - #23341 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'tools/h5copy')
-rw-r--r--tools/h5copy/CMakeLists.txt411
-rw-r--r--tools/h5copy/Makefile.in2
-rw-r--r--tools/h5copy/testfiles/h5copy_misc1.out2
-rw-r--r--tools/h5copy/testh5copy.sh.in367
4 files changed, 428 insertions, 354 deletions
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt
index 95341a2..7f68e76 100644
--- a/tools/h5copy/CMakeLists.txt
+++ b/tools/h5copy/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.8.6)
+cmake_minimum_required (VERSION 2.8.10)
PROJECT (HDF5_TOOLS_H5COPY)
#-----------------------------------------------------------------------------
@@ -44,9 +44,6 @@ IF (BUILD_TESTING)
SET (LIST_OTHER_TEST_FILES
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out
- ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.out.ls
- ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.out.ls
- ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.out.ls
)
FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
@@ -62,20 +59,6 @@ IF (BUILD_TESTING)
ARGS -E copy_if_different ${listfiles} ${dest}
)
ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
-
- #
- # This section can be removed, but leave here for a reference later.
- # Purpose: '-l3' ignores top 3 lines when copy text file.
- #
- #FOREACH (listfiles ${LIST_OTHER_TEST_FILES})
- # SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${listfiles}")
- # ADD_CUSTOM_COMMAND (
- # TARGET h5copy
- # POST_BUILD
- # COMMAND ${XLATE_UTILITY}
- # ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${listfiles} ${lsdest} -l3
- # )
- #ENDFOREACH (listfiles ${LIST_OTHER_TEST_FILES})
##############################################################################
##############################################################################
@@ -86,89 +69,189 @@ IF (BUILD_TESTING)
#
# Perform h5copy according to passing parmeters
#
- MACRO (ADD_H5_F_TEST testname resultcode infile outfile fparam vparam sparam srcname dparam dstname)
+ MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname)
+ IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ ADD_TEST (
+ NAME H5COPY_F-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ./testfiles/${testname}.out.h5
+ )
+ ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+
ADD_TEST (
NAME H5COPY_F-${testname}
- COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY_F-${testname}")
- ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname})
+ 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 (
+ 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")
ENDMACRO (ADD_H5_F_TEST)
- MACRO (ADD_H5_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname)
+ MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname)
+ IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ ADD_TEST (
+ NAME H5COPY-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ./testfiles/${testname}.out.h5
+ )
+ ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+
ADD_TEST (
NAME H5COPY-${testname}
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY-${testname}")
- ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname})
+ 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 (
+ 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")
ENDMACRO (ADD_H5_TEST)
- MACRO (ADD_H5_DIFF_TEST testname resultcode testdepends infile outfile srcname dstname)
+ MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname)
+ IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ ADD_TEST (
+ NAME H5COPY-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ./testfiles/${testname}.out.h5
+ )
+ ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+
+ 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 (
+ 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)
# resultcode=2 will cause the test to skip the diff test
IF (NOT ${resultcode} STREQUAL "2")
ADD_TEST (
- NAME H5COPY-DIFF_${testname}
- COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${outfile} ${srcname} ${dstname}
+ NAME H5COPY-${testname}-DIFF
+ COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
- SET_TESTS_PROPERTIES(H5COPY-DIFF_${testname} PROPERTIES DEPENDS ${testdepends})
- SET (last_test "H5COPY-DIFF_${testname}")
+ SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
IF (${resultcode} STREQUAL "1")
- SET_TESTS_PROPERTIES (H5COPY-DIFF_${testname} PROPERTIES WILL_FAIL "true")
+ SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
ENDIF (${resultcode} STREQUAL "1")
ENDIF (NOT ${resultcode} STREQUAL "2")
- ENDMACRO (ADD_H5_DIFF_TEST)
+ 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)
+ # Remove any output file left over from previous test run
+ ADD_TEST (
+ NAME H5COPY_SAME-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ./testfiles/${testname}.out.h5
+ )
+ ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- #
- # Test result with h5ls
- #
- MACRO (ADD_H5LS_TEST file filetest)
- # If using memchecker add tests without using scripts
+ 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)
- ADD_TEST (NAME H5COPY-h5ls_${file}-${filetest} COMMAND $<TARGET_FILE:h5ls> -Svr ./testfiles/${file}.out.h5)
+ 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)
+ # resultcode=2 will cause the test to skip the diff test
+ IF (NOT ${resultcode} STREQUAL "2")
ADD_TEST (
- NAME H5COPY-h5ls_${file}-${filetest}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
- -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -D "TEST_OUTPUT=./testfiles/${file}.out.out"
- -D "TEST_EXPECT=0"
- -D "TEST_REFERENCE=./testfiles/${file}.out.ls"
- -D "TEST_MASK=true"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ NAME H5COPY_SAME-${testname}-DIFF
+ COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
- ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-h5ls_${file}-${filetest} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY-h5ls_${file}-${filetest}")
- ENDMACRO (ADD_H5LS_TEST)
+ 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")
+ ENDMACRO (ADD_H5_TEST_SAME)
#
# Similiar to ADD_H5_TEST macro. Compare to outputs from source & target
# files instead of checking with h5ls.
#
- MACRO (ADD_H5_CMP_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname)
+ 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/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
+ 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 (
+ NAME H5COPY-CMP-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ./testfiles/${testname}.out.h5
+ ./testfiles/${testname}.out.out
+ ./testfiles/${testname}.out.out.err
+ )
ADD_TEST (
NAME H5COPY-CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy>"
- -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${outfile};${vparam};${sparam};${srcname};${dparam};${dstname}"
+ -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=./testfiles/${testname}.out.out"
-D "TEST_EXPECT=${resultcode}"
@@ -176,11 +259,8 @@ IF (BUILD_TESTING)
-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)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY-CMP-${testname}")
ENDMACRO (ADD_H5_CMP_TEST)
##############################################################################
@@ -197,172 +277,135 @@ IF (BUILD_TESTING)
SET (HDF_EXT_SRC_FILE h5copy_extlinks_src)
SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg)
- # Remove any output file left over from previous test run
- ADD_TEST (
- NAME H5COPY-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${HDF_FILE1}.out.h5
- ./testfiles/${HDF_FILE1}.out.out
- ./testfiles/${HDF_FILE1}.out.out.err
- ./testfiles/${HDF_FILE2}.out.h5
- ./testfiles/${HDF_FILE2}.out.out
- ./testfiles/${HDF_FILE2}.out.out.err
- ./testfiles/${HDF_EXT_SRC_FILE}.out.h5
- ./testfiles/${HDF_EXT_SRC_FILE}.out.out
- ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err
- )
- 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")
+ IF (HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ ADD_TEST (
+ NAME H5COPY-clearall-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ simple.out.h5
+ chunk.out.h5
+ compact.out.h5
+ compound.out.h5
+ compressed.out.h5
+ named_vl.out.h5
+ nested_vl.out.h5
+ simple_top.out.h5
+ dsrename.out.h5
+ grp_empty.out.h5
+ grp_dsets.out.h5
+ grp_nested.out.h5
+ simple_group.out.h5
+ grp_rename.out.h5
+ grp_dsets_rename.out.h5
+ A_B1_simple.out.h5
+ A_B2_simple2.out.h5
+ C_D_simple.out.h5
+ E_F_grp_dsets.out.h5
+ G_H_grp_nested.out.h5
+ region_ref.out.h5
+ ext_link.out.h5
+ ext_link_f.out.h5
+ ext_dangle_noobj.out.h5
+ ext_dangle_noobj_f.out.h5
+ ext_dangle_nofile.out.h5
+ ext_dangle_nofile_f.out.h5
+ ext_link_group.out.h5
+ ext_link_group_f.out.h5
+ samefile1.out.h5
+ samefile2.out.h5
+ h5copy_misc1.out.h5
+ 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)
# "Test copying various forms of datasets"
- ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s simple -d simple)
- ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s chunk -d chunk)
- ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compact -d compact)
- ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d compound)
- ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compressed -d compressed)
- ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s named_vl -d named_vl)
- ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s nested_vl -d nested_vl)
+ ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple)
+ ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk)
+ ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact)
+ ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound)
+ ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed)
+ ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl)
+ ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl)
# "Test copying dataset within group in source file to root of destination"
- ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets/simple -d simple_top)
+ ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top)
# "Test copying & renaming dataset"
- ADD_H5_TEST (rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d rename)
+ ADD_H5_TEST (dsrename 0 ${HDF_FILE1}.h5 -v -s compound -d rename)
# "Test copying empty, 'full' & 'nested' groups"
- ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_empty -d grp_empty)
- ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_dsets)
- ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_nested -d grp_nested)
+ ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty)
+ ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets)
+ ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested)
# "Test copying dataset within group in source file to group in destination"
- ADD_H5_TEST (simple_group 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets/simple -d /grp_dsets/simple_group)
+ ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group)
# "Test copying & renaming group"
- ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_rename)
+ ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename)
# "Test copying 'full' group hierarchy into group in destination file"
- ADD_H5_TEST (grp_dsets_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d /grp_rename/grp_dsets)
+ ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets)
# "Test copying objects into group hier. that doesn't exist yet in destination file"
- ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B1/simple)
- ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B2/simple2)
- ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple)
- ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets)
- ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_nested -d /G/H/grp_nested)
-
- # Verify that the file created above is correct
- ADD_H5LS_TEST (${HDF_FILE1} basic)
+ ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple)
+ ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2)
+ ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple)
+ ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets)
+ ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested)
############# COPY REFERENCES ##############
- # Remove any output file left over from previous test run
- ADD_TEST (
- NAME H5COPY-clear-refs
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${HDF_FILE2}.out.h5
- ./testfiles/${HDF_FILE2}.out.out
- ./testfiles/${HDF_FILE2}.out.out.err
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-clear-refs PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY-clear-refs")
-
# "Test copying object and region references"
- ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ${HDF_FILE2}.out.h5 ref -v -s / -d /COPY)
-
- # Verify that the file created above is correct
- ADD_H5LS_TEST (${HDF_FILE2} refs)
+ ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY)
############# COPY EXT LINKS ##############
- # Remove any output file left over from previous test run
- ADD_TEST (
- NAME H5COPY-clear-ext-links
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${HDF_EXT_SRC_FILE}.out.h5
- ./testfiles/${HDF_EXT_SRC_FILE}.out.out
- ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-clear-ext-links PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY-clear-ext-links")
-
# "Test copying external link directly without -f ext"
- ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_dset -d /copy1_dset)
+ ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset)
# "Test copying external link directly with -f ext"
- ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset)
+ ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset)
# "Test copying dangling external link (no obj) directly without -f ext"
- ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1)
+ ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1)
# "Test copying dangling external link (no obj) directly with -f ext"
- ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2)
+ ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2)
# "Test copying dangling external link (no file) directly without -f ext"
- ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1)
+ ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1)
# "Test copying dangling external link (no file) directly with -f ext"
- ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2)
+ ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2)
# "Test copying a group contains external links without -f ext"
- ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext -d /copy1_group)
+ ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group)
# "Test copying a group contains external links with -f ext"
- ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext -d /copy2_group)
-
- # Verify that the file created above is correct
- ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links)
+ ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group)
############# Test misc. ##############
- # Remove any output file left over from previous test run
- ADD_TEST (
- NAME H5COPY-clear-misc
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/h5copy_misc1.out.out
- ./testfiles/h5copy_misc1.out.out.err
- ./testfiles/${HDF_FILE1}.out.h5
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-clear-misc PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY-clear-misc")
#-----------------------------------------------------------------
# "Test copying object into group which doesn't exist, without -p"
#
- ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /g1/g2/simple)
- # Remove any output file left over from previous test run
- ADD_TEST (
- NAME H5COPY-clear-samefile
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${HDF_FILE1}.out.h5
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-clear-samefile PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5COPY-clear-samefile")
+ ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple)
#-------------------------------------------
# "Test copying objects to the same file "
#
- # create temporary test file with some objects
- ADD_H5_TEST (samefile1_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple)
- ADD_H5_TEST (samefile2_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets)
- # actual test cases
# - dataset
- ADD_H5_TEST (samefile1 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple_cp)
+ ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp)
# - group with some datasets
- ADD_H5_TEST (samefile2 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets_cp)
+ ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp)
ENDIF (BUILD_TESTING)
##############################################################################
diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in
index da9d0b7..3278f80 100644
--- a/tools/h5copy/Makefile.in
+++ b/tools/h5copy/Makefile.in
@@ -234,6 +234,7 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
+HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
HDF_CXX = @HDF_CXX@
@@ -285,7 +286,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
-PTHREAD = @PTHREAD@
RANLIB = @RANLIB@
ROOT = @ROOT@
RUNPARALLEL = @RUNPARALLEL@
diff --git a/tools/h5copy/testfiles/h5copy_misc1.out b/tools/h5copy/testfiles/h5copy_misc1.out
index 10dd1a6..1624f2b 100644
--- a/tools/h5copy/testfiles/h5copy_misc1.out
+++ b/tools/h5copy/testfiles/h5copy_misc1.out
@@ -1,3 +1,3 @@
-Copying file <./testfiles/h5copytst.h5> and object </simple> to file <./testfiles/h5copytst.out.h5> and object </g1/g2/simple>
+Copying file <./testfiles/h5copytst.h5> and object </simple> to file <./testfiles/h5copy_misc1.out.h5> and object </g1/g2/simple>
Error in copy...Exiting
h5copy error: group </g1> doesn't exist. Use -p to create parent groups.
diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in
index c7acd9a..d30d8d8 100644
--- a/tools/h5copy/testh5copy.sh.in
+++ b/tools/h5copy/testh5copy.sh.in
@@ -57,9 +57,6 @@ $SRC_H5COPY_TESTFILES/h5copy_extlinks_trg.h5
# List of expect files that will be copied over to local test dir
LIST_OTHER_TEST_FILES="
-$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.out.ls
-$SRC_H5COPY_TESTFILES/h5copy_ref.out.ls
-$SRC_H5COPY_TESTFILES/h5copytst.out.ls
$SRC_H5COPY_TESTFILES/h5copy_misc1.out
"
@@ -151,15 +148,6 @@ VERIFY()
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Verifying".
#
-VERIFY_H5LS()
-{
- SPACES=" "
- echo "Verifying h5ls file structure $* $SPACES" | cut -c1-70 | tr -d '\012'
-}
-
-# Print a line-line message left justified in a field of 70 characters
-# beginning with the word "Verifying".
-#
VERIFY_OUTPUT()
{
SPACES=" "
@@ -183,24 +171,34 @@ TOOLTEST()
{
actualout="$TESTDIR/tooltest.actualout"
actualerr="$TESTDIR/tooltest.actualerr"
- runh5diff=yes
- if [ "$1" = -i ]; then
- inputfile=$2
- else
- runh5diff=no
- fi
- if [ "$3" = -o ]; then
- outputfile=$4
- else
- runh5diff=no
- fi
+ runh5diff=yes
+ if [ "$1" = -i ]; then
+ inputfile=$2
+ else
+ if [ "$1" = -f ]; then
+ inputfile=$4
+ else
+ inputfile=$3
+ fi
+ runh5diff=no
+ fi
+ if [ "$3" = -o ]; then
+ outputfile=$4
+ else
+ if [ "$1" = -f ]; then
+ outputfile=$6
+ else
+ outputfile=$5
+ fi
+ runh5diff=no
+ fi
TESTING $H5COPY $@
(
- echo "#############################"
- echo " output for '$H5COPY $@'"
- echo "#############################"
- $RUNSERIAL $H5COPY_BIN $@
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN $@
) > $actualout 2> $actualerr
RET=$?
if [ $RET != 0 ]; then
@@ -210,15 +208,141 @@ TOOLTEST()
nerrors="`expr $nerrors + 1`"
else
echo " PASSED"
+
+ if [ $runh5diff != no ]; then
+ H5DIFFTEST $inputfile $outputfile $7 $9
+ fi
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actualout $actualerr
+ rm -f $actualout $actualerr $outputfile
+ fi
+ fi
+}
+
+# TOOLTEST back-to-back
+TOOLTEST_PREFILL()
+{
+ actualout="$TESTDIR/tooltest.actualout"
+ actualerr="$TESTDIR/tooltest.actualerr"
+ runh5diff=yes
+ if [ "$1" = -i ]; then
+ inputfile=$2
+ else
+ runh5diff=no
+ fi
+ if [ "$3" = -o ]; then
+ outputfile=$4
+ else
+ runh5diff=no
+ fi
+
+ grp_name=$5
+ grp_name2=$6
+ obj_name=$7
+ obj_name2=$8
+
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+
+ if [ $runh5diff != no ]; then
+ H5DIFFTEST $inputfile $outputfile $obj_name $obj_name2
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actualout $actualerr $outputfile
+ fi
fi
fi
+}
+
+# TOOLTEST back-to-back
+TOOLTEST_SAME()
+{
+ actualout="$TESTDIR/tooltest.actualout"
+ actualerr="$TESTDIR/tooltest.actualerr"
+ runh5diff=yes
+ if [ "$1" = -i ]; then
+ inputfile=$2
+ else
+ runh5diff=no
+ fi
+ if [ "$3" = -o ]; then
+ outputfile=$4
+ else
+ runh5diff=no
+ fi
- if [ $runh5diff != no ]; then
- H5DIFFTEST $inputfile $outputfile $7 $9
+ grp_name=$5
+ grp_name2=$6
+
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+
+ if [ $runh5diff != no ]; then
+ H5DIFFTEST $outputfile $outputfile $grp_name $grp_name2
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actualout $actualerr $outputfile
+ fi
+ fi
fi
}
@@ -259,18 +383,18 @@ TOOLTEST_FAIL()
actualerr_sav=${actualerr}-sav
shift
if [ "$1" = -i ]; then
- inputfile=$2
+ inputfile=$2
fi
if [ "$3" = -o ]; then
- outputfile=$4
+ outputfile=$4
fi
TESTING $H5COPY $@
(
- #echo "#############################"
- #echo " output for '$H5COPY $@'"
- #echo "#############################"
- $RUNSERIAL $H5COPY_BIN $@
+ #echo "#############################"
+ #echo " output for '$H5COPY $@'"
+ #echo "#############################"
+ $RUNSERIAL $H5COPY_BIN $@
) > $actualout 2> $actualerr
RET=$?
@@ -298,7 +422,7 @@ TOOLTEST_FAIL()
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actualout $actualerr $actualout_sav $actualerr_sav
+ rm -f $actualout $actualerr $actualout_sav $actualerr_sav $outputfile
fi
}
@@ -311,10 +435,10 @@ H5DIFFTEST()
$RUNSERIAL $H5DIFF_BIN -q "$@"
RET=$?
if [ $RET != 0 ] ; then
- echo "*FAILED*"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
else
- echo " PASSED"
+ echo " PASSED"
fi
}
@@ -327,50 +451,13 @@ H5DIFFTEST_FAIL()
RET=$?
if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then
- echo "*FAILED*"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
else
- echo " PASSED"
+ echo " PASSED"
fi
}
-# Call the h5ls tool to verify the correct output data in the destination file
-#
-H5LSTEST()
-{
- expect="$TESTDIR/`basename $1 .h5`.ls"
- actual="$TESTDIR/`basename $1 .h5`.ls.actualout"
-
- # Stderr is included in stdout so that the diff can detect
- # any unexpected output from that stream too.
- #
- # Note: The modification time and storage utilization are masked off
- # so that the output is more portable
- VERIFY_H5LS $@
- (
- $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@
- ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' |sed 's/Storage:.*/Storage: <details removed for portability>/' >$actual
-
-
- if [ ! -f $expect ]; then
- # Create the expect file if it doesn't yet exist.
- echo " CREATED"
- cp $actual $expect
- elif $CMP $expect $actual; then
- echo " PASSED"
- else
- echo "*FAILED*"
- echo " Expected result (*.ls) differs from actual result (*.out)"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
- fi
-
- # Clean up output file
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actual $actual_err
- fi
-}
-
# Copy single datasets of various forms from one group to another,
# adding object copied to the destination file each time
#
@@ -379,82 +466,54 @@ H5LSTEST()
COPY_OBJECTS()
{
TESTFILE="$TESTDIR/h5copytst.h5"
- FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $FILEOUT
- echo "Testing from `basename $TESTFILE` to `basename $FILEOUT` for the following tests:"
echo "Test copying various forms of datasets"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s simple -d simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s chunk -d chunk
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compact -d compact
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d compound
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compressed -d compressed
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s named_vl -d named_vl
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s nested_vl -d nested_vl
+ TOOLTEST -i $TESTFILE -o $TESTDIR/simple.out.h5 -v -s simple -d simple
+ TOOLTEST -i $TESTFILE -o $TESTDIR/chunk.out.h5 -v -s chunk -d chunk
+ TOOLTEST -i $TESTFILE -o $TESTDIR/compact.out.h5 -v -s compact -d compact
+ TOOLTEST -i $TESTFILE -o $TESTDIR/compound.out.h5 -v -s compound -d compound
+ TOOLTEST -i $TESTFILE -o $TESTDIR/compressed.out.h5 -v -s compressed -d compressed
+ TOOLTEST -i $TESTFILE -o $TESTDIR/named_vl.out.h5 -v -s named_vl -d named_vl
+ TOOLTEST -i $TESTFILE -o $TESTDIR/nested_vl.out.h5 -v -s nested_vl -d nested_vl
echo "Test copying dataset within group in source file to root of destination"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets/simple -d simple_top
+ TOOLTEST -i $TESTFILE -o $TESTDIR/simple_top.out.h5 -v -s grp_dsets/simple -d simple_top
echo "Test copying & renaming dataset"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d rename
+ TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename
echo "Test copying empty, 'full' & 'nested' groups"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_empty -d grp_empty
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_dsets
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_nested -d grp_nested
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested
echo "Test copying dataset within group in source file to group in destination"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets/simple -d /grp_dsets/simple_group
+ TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group
echo "Test copying & renaming group"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename
echo "Test copying 'full' group hierarchy into group in destination file"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets
+ TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets
echo "Test copying objects into group hier. that doesn't exist yet in destination file"
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B1/simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B2/simple2
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets/simple -d /C/D/simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested
-
- # Verify that the file created above is correct
- H5LSTEST $FILEOUT
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple
+ TOOLTEST -i $TESTFILE -o $TESTDIR/A_B2_simple2.out.h5 -vp -s simple -d /A/B2/simple2
+ TOOLTEST -i $TESTFILE -o $TESTDIR/C_D_simple.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple
+ TOOLTEST -i $TESTFILE -o $TESTDIR/E_F_grp_dsets.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets
+ TOOLTEST -i $TESTFILE -o $TESTDIR/G_H_grp_nested.out.h5 -vp -s /grp_nested -d /G/H/grp_nested
}
# Copy references in various way.
-# adding to the destination file each time compare the result
#
# Assumed arguments:
# <none>
COPY_REFERENCES()
{
TESTFILE="$TESTDIR/h5copy_ref.h5"
- FILEOUT="$TESTDIR/`basename h5copy_ref.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $FILEOUT
echo "Test copying object and region references"
- TOOLTEST -f ref -i $TESTFILE -o $FILEOUT -v -s / -d /COPY
-
- # Verify that the file created above is correct
- H5LSTEST $FILEOUT
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY
}
# Copy external links.
@@ -465,43 +524,30 @@ COPY_REFERENCES()
COPY_EXT_LINKS()
{
TESTFILE="$TESTDIR/h5copy_extlinks_src.h5"
- FILEOUT="$TESTDIR/`basename h5copy_extlinks_src.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $FILEOUT
echo "Test copying external link directly without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_dset -d /copy1_dset
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset
echo "Test copying external link directly with -f ext"
- TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_dset -d /copy2_dset
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset
echo "Test copying dangling external link (no obj) directly without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet1 -d /copy_dangle1_1
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1
echo "Test copying dangling external link (no obj) directly with -f ext"
- TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2
echo "Test copying dangling external link (no file) directly without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet2 -d /copy_dangle2_1
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1
echo "Test copying dangling external link (no file) directly with -f ext"
- TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2
echo "Test copying a group contains external links without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy1_group
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group
echo "Test copying a group contains external links with -f ext"
- TOOLTEST -f ext -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy2_group
-
- # Verify that the file created above is correct
- H5LSTEST $FILEOUT
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group
}
# Test misc.
@@ -511,28 +557,13 @@ COPY_EXT_LINKS()
TEST_MISC()
{
TESTFILE="$TESTDIR/h5copytst.h5"
- FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $FILEOUT
echo "Test copying object into group which doesn't exist, without -p"
- TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o $FILEOUT -s /simple -d /g1/g2/simple
+ TOOLTEST_FAIL h5copy_misc1.out -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -v -s /simple -d /g1/g2/simple
echo "Test copying objects to the same file "
- rm -f $FILEOUT
- # create temporary test file ($FILEOUT) with some objects
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /simple -d /simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets -d /grp_dsets
- # actual test cases
- TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /simple -d /simple_cp
- TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /grp_dsets -d /grp_dsets_cp
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp
+ TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile2.out.h5 /grp_dsets /grp_dsets_cp
}
##############################################################################