diff options
Diffstat (limited to 'tools/h5copy')
| -rw-r--r-- | tools/h5copy/CMakeLists.txt | 384 | ||||
| -rw-r--r-- | tools/h5copy/Makefile.am | 49 | ||||
| -rw-r--r-- | tools/h5copy/Makefile.in | 982 | ||||
| -rw-r--r-- | tools/h5copy/h5copy.c | 521 | ||||
| -rw-r--r-- | tools/h5copy/h5copygentest.c | 896 | ||||
| -rw-r--r-- | tools/h5copy/testfiles/h5copy_extlinks_src.h5 | bin | 2184 -> 0 bytes | |||
| -rw-r--r-- | tools/h5copy/testfiles/h5copy_extlinks_src.out.ls | 43 | ||||
| -rw-r--r-- | tools/h5copy/testfiles/h5copy_extlinks_trg.h5 | bin | 2168 -> 0 bytes | |||
| -rw-r--r-- | tools/h5copy/testfiles/h5copy_misc1.out | 3 | ||||
| -rw-r--r-- | tools/h5copy/testfiles/h5copy_ref.h5 | bin | 9104 -> 0 bytes | |||
| -rw-r--r-- | tools/h5copy/testfiles/h5copy_ref.out.ls | 31 | ||||
| -rw-r--r-- | tools/h5copy/testfiles/h5copytst.h5 | bin | 30448 -> 0 bytes | |||
| -rw-r--r-- | tools/h5copy/testfiles/h5copytst.out.ls | 429 | ||||
| -rw-r--r-- | tools/h5copy/testh5copy.sh | 548 |
14 files changed, 0 insertions, 3886 deletions
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt deleted file mode 100644 index f9e7c12..0000000 --- a/tools/h5copy/CMakeLists.txt +++ /dev/null @@ -1,384 +0,0 @@ -cmake_minimum_required (VERSION 2.8.6) -PROJECT (HDF5_TOOLS_H5COPY) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) - -# -------------------------------------------------------------------- -# Add the h5copy and test executables -# -------------------------------------------------------------------- -ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) -TARGET_NAMING (h5copy ${LIB_TYPE}) -TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) - -SET (H5_DEP_EXECUTABLES h5copy) - -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - -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_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) - - # -------------------------------------------------------------------- - # Copy all the HDF5 files from the source directory into the test directory - # -------------------------------------------------------------------- - 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 - ${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") - - 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 ( - TARGET h5copy - POST_BUILD - COMMAND ${CMAKE_COMMAND} - 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}) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - # - # Perform h5copy according to passing parmeters - # - MACRO (ADD_H5_F_TEST testname resultcode infile outfile fparam vparam sparam srcname dparam dstname) - ADD_TEST ( - NAME H5COPY_F-${testname} - COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${outfile} ${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}) - ENDMACRO (ADD_H5_F_TEST) - - MACRO (ADD_H5_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) - ADD_TEST ( - NAME H5COPY-${testname} - COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${outfile} ${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}) - ENDMACRO (ADD_H5_TEST) - - MACRO (ADD_H5_DIFF_TEST testname resultcode testdepends infile outfile srcname dstname) - # 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} - ) - SET_TESTS_PROPERTIES(H5COPY-DIFF_${testname} PROPERTIES DEPENDS ${testdepends}) - SET (last_test "H5COPY-DIFF_${testname}") - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-DIFF_${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_DIFF_TEST) - - # - # Test result with h5ls - # - MACRO (ADD_H5LS_TEST file filetest) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-h5ls_${file}-${filetest} COMMAND $<TARGET_FILE:h5ls> -Svr ./testfiles/${file}.out.h5) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - 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" - ) - 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) - - # - # 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) - # 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}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - 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_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testname}.out.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=./testfiles/${testname}.out" - -D "TEST_MASK=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - 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) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - # -------------------------------------------------------------------- - # 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) - - # 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") - - # "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) - - # "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) - - # "Test copying & renaming dataset" - ADD_H5_TEST (rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.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) - - # "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) - - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.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) - - # "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) - -############# 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) - -############# 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) - - # "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) - - # "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) - - # "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) - - # "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) - - # "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) - - # "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) - - # "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) - -############# 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") - - #------------------------------------------- - # "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) - # - 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) -ENDIF (BUILD_TESTING) - -############################################################################## -############################################################################## -### I N S T A L L A T I O N ### -############################################################################## -############################################################################## - -#-----------------------------------------------------------------------------
-# Rules for Installation of tools using make Install target
-#-----------------------------------------------------------------------------
-INSTALL ( - TARGETS - h5copy - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools - COMPONENT - toolsapplications -) diff --git a/tools/h5copy/Makefile.am b/tools/h5copy/Makefile.am deleted file mode 100644 index dd0c5c3..0000000 --- a/tools/h5copy/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. -## -## Makefile.am -## Run automake to generate a Makefile.in from this file. -# -# HDF5 Library Makefile(.in) -# - -include $(top_srcdir)/config/commence.am - -# Include src and tools/lib directories -INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib - -# Test programs and scripts -TEST_PROG=h5copygentest -TEST_SCRIPT=$(srcdir)/testh5copy.sh -check_SCRIPTS=$(TEST_SCRIPT) -SCRIPT_DEPEND=h5copy$(EXEEXT) - -# This is our main target, the h5copy tool -bin_PROGRAMS=h5copy -check_PROGRAMS=$(TEST_PROG) - -# Add h5copy specific linker flags here -h5copy_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) - -# source file for the test file generator -h5copygentest_SOURCES=h5copygentest.c - -# All programs depend on the hdf5 and h5tools libraries -LDADD=$(LIBH5TOOLS) $(LIBHDF5) - -# Temporary files. *.h5 are generated by h5dumpgentest. They should -# copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES+=*.h5 - -include $(top_srcdir)/config/conclude.am diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in deleted file mode 100644 index b71ee70..0000000 --- a/tools/h5copy/Makefile.in +++ /dev/null @@ -1,982 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. -# -# HDF5 Library Makefile(.in) -# - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/config/commence.am \ - $(top_srcdir)/config/conclude.am -bin_PROGRAMS = h5copy$(EXEEXT) -check_PROGRAMS = $(am__EXEEXT_1) -TESTS = $(check_PROGRAMS) $(check_SCRIPTS) -subdir = tools/h5copy -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -am__EXEEXT_1 = h5copygentest$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) -h5copy_SOURCES = h5copy.c -h5copy_OBJECTS = h5copy.$(OBJEXT) -h5copy_LDADD = $(LDADD) -h5copy_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -h5copy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(h5copy_LDFLAGS) $(LDFLAGS) -o $@ -am_h5copygentest_OBJECTS = h5copygentest.$(OBJEXT) -h5copygentest_OBJECTS = $(am_h5copygentest_OBJECTS) -h5copygentest_LDADD = $(LDADD) -h5copygentest_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -depcomp = $(SHELL) $(top_srcdir)/bin/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = h5copy.c $(h5copygentest_SOURCES) -DIST_SOURCES = h5copy.c $(h5copygentest_SOURCES) -ETAGS = etags -CTAGS = ctags -am__tty_colors = \ -red=; grn=; lgn=; blu=; std= -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal -ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@ -AMTAR = @AMTAR@ - -# H5_CFLAGS holds flags that should be used when building hdf5, -# but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles -# instead of CFLAGS, as CFLAGS is reserved solely for the user to define. -# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ -AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ -AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ -AR = @AR@ -AS = @AS@ - -# Set the paths for AFS installs of autotools for Linux machines -# Ideally, these tools should never be needed during the build. -AUTOCONF = /home1/packages/autoconf/autoconf-2.60/bin/autoconf -AUTOHEADER = /home1/packages/autoconf/autoconf-2.60/bin/autoheader -AUTOMAKE = /home1/packages/automake/automake-1.9.6/bin/automake-1.9 -AWK = @AWK@ -BYTESEX = @BYTESEX@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CC_VERSION = @CC_VERSION@ -CFLAGS = @CFLAGS@ -CLEARFILEBUF = @CLEARFILEBUF@ -CODESTACK = @CODESTACK@ -CONFIG_DATE = @CONFIG_DATE@ -CONFIG_MODE = @CONFIG_MODE@ -CONFIG_USER = @CONFIG_USER@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CXX_VERSION = @CXX_VERSION@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_PKG = @DEBUG_PKG@ -DEFAULT_API_VERSION = @DEFAULT_API_VERSION@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ -DIRECT_VFD = @DIRECT_VFD@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -DYNAMIC_DIRS = @DYNAMIC_DIRS@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -EXTERNAL_FILTERS = @EXTERNAL_FILTERS@ - -# Make sure that these variables are exported to the Makefiles -F9XMODEXT = @F9XMODEXT@ -F9XMODFLAG = @F9XMODFLAG@ -F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ -FC = @FC@ -FC2003 = @FC2003@ -FCFLAGS = @FCFLAGS@ -FCFLAGS_f90 = @FCFLAGS_f90@ -FCLIBS = @FCLIBS@ -FC_VERSION = @FC_VERSION@ -FGREP = @FGREP@ -FILTERS = @FILTERS@ -FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ -GREP = @GREP@ -H5_CFLAGS = @H5_CFLAGS@ -H5_CPPFLAGS = @H5_CPPFLAGS@ -H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_CXX_SHARED = @H5_CXX_SHARED@ -H5_FCFLAGS = @H5_FCFLAGS@ -H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ -H5_LDFLAGS = @H5_LDFLAGS@ -H5_LONE_COLON = @H5_LONE_COLON@ -H5_VERSION = @H5_VERSION@ -HADDR_T = @HADDR_T@ -HAVE_DMALLOC = @HAVE_DMALLOC@ -HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ -HDF5_HL = @HDF5_HL@ -HDF5_INTERFACES = @HDF5_INTERFACES@ -HDF_CXX = @HDF_CXX@ -HDF_FORTRAN = @HDF_FORTRAN@ -HDF_FORTRAN2003 = @HDF_FORTRAN2003@ -HID_T = @HID_T@ -HL = @HL@ -HL_FOR = @HL_FOR@ -HSIZE_T = @HSIZE_T@ -HSSIZE_T = @HSSIZE_T@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INSTRUMENT = @INSTRUMENT@ -INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ -LARGEFILE = @LARGEFILE@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LL_PATH = @LL_PATH@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_STATIC_EXEC = @LT_STATIC_EXEC@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MPE = @MPE@ -MPI_GET_SIZE = @MPI_GET_SIZE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PARALLEL = @PARALLEL@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PTHREAD = @PTHREAD@ -RANLIB = @RANLIB@ -ROOT = @ROOT@ -RUNPARALLEL = @RUNPARALLEL@ -RUNSERIAL = @RUNSERIAL@ -R_INTEGER = @R_INTEGER@ -R_LARGE = @R_LARGE@ -SEARCH = @SEARCH@ -SED = @SED@ -SETX = @SETX@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIZE_T = @SIZE_T@ -STATIC_EXEC = @STATIC_EXEC@ -STATIC_SHARED = @STATIC_SHARED@ -STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@ -STRIP = @STRIP@ -TESTPARALLEL = @TESTPARALLEL@ -THREADSAFE = @THREADSAFE@ -TIME = @TIME@ -TR = @TR@ -TRACE_API = @TRACE_API@ -UNAME_INFO = @UNAME_INFO@ -USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ -USE_FILTER_SZIP = @USE_FILTER_SZIP@ -USINGMEMCHECKER = @USINGMEMCHECKER@ -VERSION = @VERSION@ -WORDS_BIGENDIAN = @WORDS_BIGENDIAN@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_FC = @ac_ct_FC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ - -# Install directories that automake doesn't know about -docdir = $(exec_prefix)/doc -dvidir = @dvidir@ -enable_shared = @enable_shared@ -enable_static = @enable_static@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# Shell commands used in Makefiles -RM = rm -f -CP = cp - -# Some machines need a command to run executables; this is that command -# so that our tests will run. -# We use RUNEXEC instead of RUNSERIAL directly because it may be that -# some tests need to be run with a different command. Older versions -# of the makefiles used the command -# $(LIBTOOL) --mode=execute -# in some directories, for instance. -RUNEXEC = $(RUNSERIAL) - -# Libraries to link to while building -LIBHDF5 = $(top_builddir)/src/libhdf5.la -LIBH5TEST = $(top_builddir)/test/libh5test.la -LIBH5F = $(top_builddir)/fortran/src/libhdf5_fortran.la -LIBH5FTEST = $(top_builddir)/fortran/test/libh5test_fortran.la -LIBH5CPP = $(top_builddir)/c++/src/libhdf5_cpp.la -LIBH5TOOLS = $(top_builddir)/tools/lib/libh5tools.la -LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la -LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la -LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la - -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. - -# Scripts used to build examples -# If only shared libraries have been installed, have h5cc build examples with -# shared libraries instead of static libraries -H5CC = ${DESTDIR}$(bindir)/h5cc -H5CC_PP = ${DESTDIR}$(bindir)/h5pcc -H5FC = ${DESTDIR}$(bindir)/h5fc -H5FC_PP = ${DESTDIR}$(bindir)/h5pfc -H5CPP = ${DESTDIR}$(bindir)/h5c++ -ACLOCAL_AMFLAGS = "-I m4" - -# The trace script; this is used on source files from the C library to -# insert tracing macros. -TRACE = perl $(top_srcdir)/bin/trace - -# .chkexe files are used to mark tests that have run successfully. -# .chklog files are output from those tests. -# *.clog are from the MPE option. - -# Temporary files. *.h5 are generated by h5dumpgentest. They should -# copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 - -# Include src and tools/lib directories -INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib - -# Test programs and scripts -TEST_PROG = h5copygentest -TEST_SCRIPT = $(srcdir)/testh5copy.sh -check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = h5copy$(EXEEXT) - -# Add h5copy specific linker flags here -h5copy_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) - -# source file for the test file generator -h5copygentest_SOURCES = h5copygentest.c - -# All programs depend on the hdf5 and h5tools libraries -LDADD = $(LIBH5TOOLS) $(LIBHDF5) - -# Automake needs to be taught how to build lib, progs, and tests targets. -# These will be filled in automatically for the most part (e.g., -# lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and -# EXTRA_TEST variables are supplied to allow the user to force targets to -# be built at certain times. -LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ - $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) - -PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ - $(EXTRA_PROG) - -TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_) -TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_) -TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_) -TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/h5copy/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign tools/h5copy/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -h5copy$(EXEEXT): $(h5copy_OBJECTS) $(h5copy_DEPENDENCIES) - @rm -f h5copy$(EXEEXT) - $(AM_V_CCLD)$(h5copy_LINK) $(h5copy_OBJECTS) $(h5copy_LDADD) $(LIBS) -h5copygentest$(EXEEXT): $(h5copygentest_OBJECTS) $(h5copygentest_DEPENDENCIES) - @rm -f h5copygentest$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(h5copygentest_OBJECTS) $(h5copygentest_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5copy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5copygentest.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(PROGRAMS) all-local -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool mostlyclean-local - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \ - clean clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - mostlyclean-local pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS - - -# List all build rules defined by HDF5 Makefiles as "PHONY" targets here. -# This tells the Makefiles that these targets are not files to be built but -# commands that should be executed even if a file with the same name already -# exists. -.PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help - -help: - @$(top_srcdir)/bin/makehelp - -# lib/progs/tests targets recurse into subdirectories. build-* targets -# build files in this directory. -build-lib: $(LIB) -build-progs: $(LIB) $(PROGS) -build-tests: $(LIB) $(PROGS) $(TESTS) - -# General rule for recursive building targets. -# BUILT_SOURCES contain targets that need to be built before anything else -# in the directory (e.g., for Fortran type detection) -lib progs tests check-s check-p :: $(BUILT_SOURCES) - @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; - @for d in X $(SUBDIRS); do \ - if test $$d != X && test $$d != .; then \ - (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ - done - -# General rule for recursive cleaning targets. Like the rule above, -# but doesn't require building BUILT_SOURCES. -check-clean :: - @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; - @for d in X $(SUBDIRS); do \ - if test $$d != X && test $$d != .; then \ - (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ - done - -# Tell Automake to build tests when the user types `make all' (this is -# not its default behavior). Also build EXTRA_LIB and EXTRA_PROG since -# Automake won't build them automatically, either. -all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(TESTS) - -# make install-doc doesn't do anything outside of doc directory, but -# Makefiles should recognize it. -# UPDATE: docs no longer reside in this build tree, so this target -# is depreciated. -install-doc uninstall-doc: - @echo "Nothing to be done." - -# clean up files generated by tests so they can be re-run. -build-check-clean: - $(RM) -rf $(CHECK_CLEANFILES) - -# run check-clean whenever mostlyclean is run -mostlyclean-local: build-check-clean - -# check-install is just a synonym for installcheck -check-install: installcheck - -# Run each test in order, passing $(TEST_FLAGS) to the program. -# Since tests are done in a shell loop, "make -i" does apply inside it. -# Set HDF5_Make_Ignore to a non-blank string to ignore errors inside the loop. -# The timestamps give a rough idea how much time the tests use. -# -# Note that targets in TESTS (defined above) will be built when the user -# types 'make tests' or 'make check', but only programs in TEST_PROG, -# TEST_PROG_PARA, or TEST_SCRIPT will actually be executed. -check-TESTS: test - -test _test: - @$(MAKE) build-check-s - @$(MAKE) build-check-p - -# Actual execution of check-s. -build-check-s: $(LIB) $(PROGS) $(TESTS) - @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \ - echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \ - fi - @$(MAKE) $(AM_MAKEFLAGS) _exec_check-s - @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \ - echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\ - fi - -_exec_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH) - -# The dummy.chkexe here prevents the target from being -# empty if there are no tests in the current directory. -# $${log} is the log file. -# $${tname} is the name of test. -$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: - @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummy.chkexe_"; then \ - tname=$(@:.chkexe_=)$(EXEEXT);\ - log=$(@:.chkexe_=.chklog); \ - echo "============================"; \ - if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \ - echo "No need to test $${tname} again."; \ - else \ - echo "============================" > $${log}; \ - if test "X$(FORTRAN_API)" = "Xyes"; then \ - echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ - echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ - elif test "X$(CXX_API)" = "Xyes"; then \ - echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ - echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\ - else \ - echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ - echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ - fi; \ - echo "============================" >> $${log}; \ - srcdir="$(srcdir)" \ - $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ - && touch $(@:.chkexe_=.chkexe) || \ - (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ - (cat $${log} && false) || exit 1; \ - echo "" >> $${log}; \ - echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \ - echo "============================" >> $${log}; \ - echo "Finished testing $${tname} $(TEST_FLAGS)"; \ - cat $${log}; \ - fi; \ - fi - -# The dummysh.chkexe here prevents the target from being -# empty if there are no tests in the current directory. -# $${log} is the log file. -# $${tname} is the name of test. -$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_: - @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummysh.chkexe_"; then \ - cmd=$(@:.chkexe_=);\ - tname=`basename $$cmd`;\ - chkname=`basename $(@:.chkexe_=.chkexe)`;\ - log=`basename $(@:.chkexe_=.chklog)`; \ - echo "============================"; \ - if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \ - echo "No need to test $${tname} again."; \ - else \ - echo "============================" > $${log}; \ - if test "X$(FORTRAN_API)" = "Xyes"; then \ - echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \ - echo "Fortran API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ - elif test "X$(CXX_API)" = "Xyes"; then \ - echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \ - echo "C++ API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ - else \ - echo "Testing $${tname} $(TEST_FLAGS)"; \ - echo "$${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ - fi; \ - echo "============================" >> $${log}; \ - RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \ - srcdir="$(srcdir)" \ - $(TIME) $(SHELL) $$cmd $(TEST_FLAGS) >> $${log} 2>&1 \ - && touch $${chkname} || \ - (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ - (cat $${log} && false) || exit 1; \ - echo "" >> $${log}; \ - echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \ - echo "============================" >> $${log}; \ - echo "Finished testing $${tname} $(TEST_FLAGS)"; \ - cat $${log}; \ - fi; \ - echo "============================"; \ - fi - -# Actual execution of check-p. -build-check-p: $(LIB) $(PROGS) $(TESTS) - @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \ - echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \ - fi - @if test -n "$(TEST_PROG_PARA)"; then \ - echo "**** Hint ****"; \ - echo "Parallel test files reside in the current directory" \ - "by default."; \ - echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \ - echo " HDF5_PARAPREFIX=/PFS/user/me"; \ - echo " export HDF5_PARAPREFIX"; \ - echo " make check"; \ - echo "**** end of Hint ****"; \ - fi - @for test in $(TEST_PROG_PARA) dummy; do \ - if test $$test != dummy; then \ - $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNEXEC="$(RUNPARALLEL)" || exit 1; \ - fi; \ - done - @for test in $(TEST_SCRIPT_PARA) dummy; do \ - if test $$test != dummy; then \ - $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ || exit 1; \ - fi; \ - done - @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \ - echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\ - fi - -# Run test with different Virtual File Driver -check-vfd: $(LIB) $(PROGS) $(TESTS) - @for vfd in $(VFD_LIST) dummy; do \ - if test $$vfd != dummy; then \ - echo "============================"; \ - echo "Testing Virtual File Driver $$vfd"; \ - echo "============================"; \ - $(MAKE) $(AM_MAKEFLAGS) check-clean || exit 1; \ - HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \ - fi; \ - done - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c deleted file mode 100644 index 574ba94..0000000 --- a/tools/h5copy/h5copy.c +++ /dev/null @@ -1,521 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include "H5private.h" -#include "h5tools.h" -#include "h5tools_utils.h" -#include <string.h> -#include <stdlib.h> - -/* Name of tool */ -#define PROGRAMNAME "h5copy" - -/* command-line options: short and long-named parameters */ -static const char *s_opts = "d:f:hi:o:ps:vV"; -static struct long_options l_opts[] = { - { "destination", require_arg, 'd' }, - { "flag", require_arg, 'f' }, - { "help", no_arg, 'h' }, - { "input", require_arg, 'i' }, - { "output", require_arg, 'o' }, - { "parents", no_arg, 'p' }, - { "source", require_arg, 's' }, - { "verbose", no_arg, 'v' }, - { "version", no_arg, 'V' }, - { NULL, 0, '\0' } -}; - -/*------------------------------------------------------------------------- - * Function: leave - * - * Purpose: Shutdown MPI & HDF5 and call exit() - * - * Return: Does not return - * - * Programmer: Quincey Koziol - * Saturday, 31. January 2004 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -leave(int ret) -{ - h5tools_close(); - HDexit(ret); -} - - -/*------------------------------------------------------------------------- - * Function: usage - * - * Purpose: Prints a usage message on stderr and then returns. - * - * Return: void - * - * Programmer: Pedro Vicente Nunes, 7/8/2006 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -usage (void) -{ - HDfprintf(stdout, "\ -usage: h5copy [OPTIONS] [OBJECTS...]\n\ - OBJECTS\n\ - -i, --input input file name\n\ - -o, --output output file name\n\ - -s, --source source object name\n\ - -d, --destination destination object name\n\ - OPTIONS\n\ - -h, --help Print a usage message and exit\n\ - -p, --parents No error if existing, make parent groups as needed\n\ - -v, --verbose Print information about OBJECTS and OPTIONS\n\ - -V, --version Print version number and exit\n\ - -f, --flag Flag type\n\n\ - Flag type is one of the following strings:\n\n\ - shallow Copy only immediate members for groups\n\n\ - soft Expand soft links into new objects\n\n\ - ext Expand external links into new objects\n\n\ - ref Copy references and any referenced objects, i.e., objects\n\ - that the references point to.\n\ - Referenced objects are copied in addition to the objects\n\ - specified on the command line and reference datasets are\n\ - populated with correct reference values. Copies of referenced\n\ - datasets outside the copy range specified on the command line\n\ - will normally have a different name from the original.\n\ - (Default:Without this option, reference value(s) in any\n\ - reference datasets are set to NULL and referenced objects are\n\ - not copied unless they are otherwise within the copy range\n\ - specified on the command line.)\n\n\ - noattr Copy object without copying attributes\n\n\ - allflags Switches all flags from the default to the non-default setting\n\n\ - These flag types correspond to the following API symbols\n\n\ - H5O_COPY_SHALLOW_HIERARCHY_FLAG\n\ - H5O_COPY_EXPAND_SOFT_LINK_FLAG\n\ - H5O_COPY_EXPAND_EXT_LINK_FLAG\n\ - H5O_COPY_EXPAND_REFERENCE_FLAG\n\ - H5O_COPY_WITHOUT_ATTR_FLAG\n\ - H5O_COPY_ALL\n"); -} - - - -/*------------------------------------------------------------------------- - * Function: parse_flag - * - * Purpose: read the flag -f STRING - * - * STRING is one of the following (API symbol and description) - * - * shallow H5O_COPY_SHALLOW_HIERARCHY_FLAG: Copy only immediate members for groups - * soft H5O_COPY_EXPAND_SOFT_LINK_FLAG: Expand soft links into new objects - * ext H5O_COPY_EXPAND_EXT_LINK_FLAG: Expand external links into new objects - * ref H5O_COPY_EXPAND_OBJ_REFERENCE_FLAG: Copy objects that are pointed by references - * noattr H5O_COPY_WITHOUT_ATTR_FLAG Copy object without copying attributes - * allflags Switches all flags from the default to the non-default setting - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Pedro Vicente Nunes, 7/8/2006 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ - - -static int parse_flag(const char* str_flag, unsigned *flag) -{ - unsigned fla=0; - - if (HDstrcmp(str_flag,"shallow")==0) - { - fla = H5O_COPY_SHALLOW_HIERARCHY_FLAG; - } - else if (HDstrcmp(str_flag,"soft")==0) - { - fla = H5O_COPY_EXPAND_SOFT_LINK_FLAG; - } - else if (HDstrcmp(str_flag,"ext")==0) - { - fla = H5O_COPY_EXPAND_EXT_LINK_FLAG; - } - else if (HDstrcmp(str_flag,"ref")==0) - { - fla = H5O_COPY_EXPAND_REFERENCE_FLAG; - } - else if (HDstrcmp(str_flag,"noattr")==0) - { - fla = H5O_COPY_WITHOUT_ATTR_FLAG; - } - else if (HDstrcmp(str_flag,"allflags")==0) - { - fla = H5O_COPY_ALL; - } - else if (HDstrcmp(str_flag,"nullmsg")==0) - { - fla = H5O_COPY_PRESERVE_NULL_FLAG; - } - else - { - error_msg("Error in input flag\n"); - return -1; - } - - *flag = (*flag) | fla; - - return 0; -} - -/*------------------------------------------------------------------------- - * Function: main - * - * Purpose: main program - * - * Programmer: Pedro Vicente Nunes - * - * Modifications: - * - *------------------------------------------------------------------------- - */ - -int -main (int argc, const char *argv[]) -{ - hid_t fid_src=-1; - hid_t fid_dst=-1; - char *fname_src=NULL; - char *fname_dst=NULL; - char *oname_src=NULL; - char *oname_dst=NULL; - unsigned flag=0; - unsigned verbose=0; - unsigned parents=0; - hid_t ocpl_id = (-1); /* Object copy property list */ - hid_t lcpl_id = (-1); /* Link creation property list */ - char str_flag[20]; - int opt; - int li_ret; - h5tool_link_info_t linkinfo; - int i, len; - char *str_ptr=NULL; - - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - - /* initialize h5tools lib */ - h5tools_init(); - - /* init linkinfo struct */ - HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); - - /* Check for no command line parameters */ - if(argc == 1) - { - usage(); - leave(EXIT_FAILURE); - } /* end if */ - - /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) - { - switch ((char)opt) - { - case 'd': - oname_dst = HDstrdup(opt_arg); - break; - - case 'f': - /* validate flag */ - if (parse_flag(opt_arg,&flag)<0) - { - usage(); - leave(EXIT_FAILURE); - } - HDstrcpy(str_flag,opt_arg); - break; - - case 'h': - usage(); - leave(EXIT_SUCCESS); - break; - - case 'i': - fname_src = HDstrdup(opt_arg); - break; - - case 'o': - fname_dst = HDstrdup(opt_arg); - break; - - case 'p': - parents = 1; - break; - - case 's': - oname_src = HDstrdup(opt_arg); - break; - - case 'V': - print_version(h5tools_getprogname()); - leave(EXIT_SUCCESS); - break; - - case 'v': - verbose = 1; - break; - - default: - usage(); - leave(EXIT_FAILURE); - } - } /* end of while */ - -/*------------------------------------------------------------------------- - * check for missing file/object names - *-------------------------------------------------------------------------*/ - - if (fname_src==NULL) - { - error_msg("Input file name missing\n"); - usage(); - leave(EXIT_FAILURE); - } - - if (fname_dst==NULL) - { - error_msg("Output file name missing\n"); - usage(); - leave(EXIT_FAILURE); - } - - if (oname_src==NULL) - { - error_msg("Source object name missing\n"); - usage(); - leave(EXIT_FAILURE); - } - - if (oname_dst==NULL) - { - error_msg("Destination object name missing\n"); - usage(); - leave(EXIT_FAILURE); - } - - /*------------------------------------------------------------------------- - * open output file - *-------------------------------------------------------------------------*/ - - /* Attempt to open an existing HDF5 file first. Need to open the dst file - before the src file just in case that the dst and src are the same file - */ - fid_dst = h5tools_fopen(fname_dst, H5F_ACC_RDWR, H5P_DEFAULT, NULL, NULL, 0); - - /*------------------------------------------------------------------------- - * open input file - *-------------------------------------------------------------------------*/ - - fid_src = h5tools_fopen(fname_src, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0); - - /*------------------------------------------------------------------------- - * test for error in opening input file - *-------------------------------------------------------------------------*/ - if (fid_src==-1) - { - error_msg("Could not open input file <%s>...Exiting\n", fname_src); - if (fname_src) - HDfree(fname_src); - leave(EXIT_FAILURE); - } - - - /*------------------------------------------------------------------------- - * create an output file when failed to open it - *-------------------------------------------------------------------------*/ - - /* If we couldn't open an existing file, try creating file */ - /* (use "EXCL" instead of "TRUNC", so we don't blow away existing non-HDF5 file) */ - if(fid_dst < 0) - fid_dst = H5Fcreate(fname_dst, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); - - /*------------------------------------------------------------------------- - * test for error in opening output file - *-------------------------------------------------------------------------*/ - if (fid_dst==-1) - { - error_msg("Could not open output file <%s>...Exiting\n", fname_dst); - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); - leave(EXIT_FAILURE); - } - - /*------------------------------------------------------------------------- - * print some info - *-------------------------------------------------------------------------*/ - - if (verbose) - { - printf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n", - fname_src, oname_src, fname_dst, oname_dst); - if (flag) - printf("Using %s flag\n", str_flag); - } - - - /*------------------------------------------------------------------------- - * create property lists for copy - *-------------------------------------------------------------------------*/ - - /* create property to pass copy options */ - if ( (ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) - goto error; - - /* set options for object copy */ - if (flag) - { - if ( H5Pset_copy_object(ocpl_id, flag) < 0) - goto error; - } - - /* Create link creation property list */ - if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { - error_msg("Could not create link creation property list\n"); - goto error; - } /* end if */ - - /* Check for creating intermediate groups */ - if(parents) { - /* Set the intermediate group creation property */ - if(H5Pset_create_intermediate_group(lcpl_id, 1) < 0) { - error_msg("Could not set property for creating parent groups\n"); - goto error; - } /* end if */ - - /* Display some output if requested */ - if(verbose) - printf("%s: Creating parent groups\n", h5tools_getprogname()); - } /* end if */ - else /* error, if parent groups doesn't already exist in destination file */ - { - len = HDstrlen(oname_dst); - /* check if all the parents groups exist. skip root group */ - for (i = 1; i < len; i++) - { - if ('/'==oname_dst[i]) - { - str_ptr = (char*)HDcalloc((size_t)i+1, sizeof(char)); - HDstrncpy (str_ptr, oname_dst, (size_t)i); - str_ptr[i]='\0'; - if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) - { - error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); - HDfree(str_ptr); - goto error; - } - HDfree(str_ptr); - } - } - } - - /*------------------------------------------------------------------------- - * do the copy - *-------------------------------------------------------------------------*/ - - if(verbose) - linkinfo.opt.msg_mode = 1; - - li_ret = H5tools_get_symlink_info(fid_src, oname_src, &linkinfo, 1); - if (li_ret == 0) /* dangling link */ - { - if(H5Lcopy(fid_src, oname_src, - fid_dst, oname_dst, - H5P_DEFAULT, H5P_DEFAULT) < 0) - goto error; - } - else /* valid link */ - { - if (H5Ocopy(fid_src, /* Source file or group identifier */ - oname_src, /* Name of the source object to be copied */ - fid_dst, /* Destination file or group identifier */ - oname_dst, /* Name of the destination object */ - ocpl_id, /* Object copy property list */ - lcpl_id)<0) /* Link creation property list */ - goto error; - } - - /* free link info path */ - if (linkinfo.trg_path) - HDfree((char*)linkinfo.trg_path); - - /* close propertis */ - if(H5Pclose(ocpl_id)<0) - goto error; - if(H5Pclose(lcpl_id)<0) - goto error; - - /* close files */ - if (H5Fclose(fid_src)<0) - goto error; - if (H5Fclose(fid_dst)<0) - goto error; - - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); - if (oname_dst) - HDfree(oname_dst); - if (oname_src) - HDfree(oname_src); - - h5tools_close(); - - return EXIT_SUCCESS; - -error: - printf("Error in copy...Exiting\n"); - - /* free link info path */ - if (linkinfo.trg_path) - HDfree((char*)linkinfo.trg_path); - - H5E_BEGIN_TRY { - H5Pclose(ocpl_id); - H5Pclose(lcpl_id); - H5Fclose(fid_src); - H5Fclose(fid_dst); - } H5E_END_TRY; - if (fname_src) - HDfree(fname_src); - if (fname_dst) - HDfree(fname_dst); - if (oname_dst) - HDfree(oname_dst); - if (oname_src) - HDfree(oname_src); - - h5tools_close(); - - return EXIT_FAILURE; -} - diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c deleted file mode 100644 index e658e92..0000000 --- a/tools/h5copy/h5copygentest.c +++ /dev/null @@ -1,896 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Generate the binary hdf5 file for the h5copy tests - */ -#include <stdlib.h> -#include "hdf5.h" -#include "H5private.h" - -/* HDF file names */ -#define HDF_FILE1 "h5copytst.h5" -#define HDF_FILE2 "h5copy_ref.h5" -#define HDF_EXT_SRC_FILE "h5copy_extlinks_src.h5" -#define HDF_EXT_TRG_FILE "h5copy_extlinks_trg.h5" - -/* objects in HDF_FILE1 */ -#define DATASET_SIMPLE "simple" -#define DATASET_CHUNK "chunk" -#define DATASET_COMPACT "compact" -#define DATASET_COMPOUND "compound" -#define DATASET_COMPRESSED "compressed" -#define DATASET_NAMED_VL "named_vl" -#define DATASET_NESTED_VL "nested_vl" -#define GROUP_EMPTY "grp_empty" -#define GROUP_DATASETS "grp_dsets" -#define GROUP_NESTED "grp_nested" - -/* Obj reference */ -#define OBJ_REF_DS "Dset1" -#define OBJ_REF_GRP "Group" -/* Region reference */ -#define REG_REF_DS1 "Dset_REGREF" -#define REG_REF_DS2 "Dset2" - - -/*------------------------------------------------------------------------- - * Function: gent_simple - * - * Purpose: Generate a simple dataset in LOC_ID - * - *------------------------------------------------------------------------- - */ -static void gent_simple(hid_t loc_id) -{ - hid_t sid, did; - hsize_t dims[1] = {6}; - int buf[6] = {1,2,3,4,5,6}; - - /* create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - - /* create dataset */ - did = H5Dcreate2(loc_id, DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* write */ - H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - - /* close */ - H5Sclose(sid); - H5Dclose(did); -} - -/*------------------------------------------------------------------------- - * Function: gent_chunked - * - * Purpose: Generate a chunked dataset in LOC_ID - * - *------------------------------------------------------------------------- - */ -static void gent_chunked(hid_t loc_id) -{ - hid_t sid, did, pid; - hsize_t dims[1] = {6}; - hsize_t chunk_dims[1] = {2}; - int buf[6] = {1,2,3,4,5,6}; - - /* create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - - /* create property plist */ - pid = H5Pcreate(H5P_DATASET_CREATE); - H5Pset_chunk(pid, 1, chunk_dims); - - /* create dataset */ - did = H5Dcreate2(loc_id, DATASET_CHUNK, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); - - /* write */ - H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - - /* close */ - H5Sclose(sid); - H5Dclose(did); - H5Pclose(pid); -} - - -/*------------------------------------------------------------------------- - * Function: gent_compact - * - * Purpose: Generate a compact dataset in LOC_ID - * - *------------------------------------------------------------------------- - */ -static void gent_compact(hid_t loc_id) -{ - hid_t sid, did, pid; - hsize_t dims[1] = {6}; - int buf[6] = {1,2,3,4,5,6}; - - /* create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - - /* create property plist */ - pid = H5Pcreate(H5P_DATASET_CREATE); - H5Pset_layout (pid,H5D_COMPACT); - - /* create dataset */ - did = H5Dcreate2(loc_id, DATASET_COMPACT, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); - - /* write */ - H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - - /* close */ - H5Sclose(sid); - H5Dclose(did); - H5Pclose(pid); -} - - -/*------------------------------------------------------------------------- - * Function: gent_compound - * - * Purpose: Generate a compound dataset in LOC_ID - * - *------------------------------------------------------------------------- - */ -static void gent_compound(hid_t loc_id) -{ - typedef struct s_t - { - char str1[20]; - char str2[20]; - } s_t; - hid_t sid, did, tid_c, tid_s; - hsize_t dims[1] = {2}; - s_t buf[2] = {{"str1", "str2"}, {"str3", "str4"}}; - - /* create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - - /* create a compound type */ - tid_c = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); - tid_s = H5Tcopy(H5T_C_S1); - H5Tset_size(tid_s, 20); - - H5Tinsert(tid_c, "str1", HOFFSET(s_t,str1), tid_s); - H5Tinsert(tid_c, "str2", HOFFSET(s_t,str2), tid_s); - - /* create dataset */ - did = H5Dcreate2(loc_id, DATASET_COMPOUND, tid_c, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* write */ - H5Dwrite(did, tid_c, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - - /* close */ - H5Sclose(sid); - H5Dclose(did); - H5Tclose(tid_c); - H5Tclose(tid_s); -} - -/*------------------------------------------------------------------------- - * Function: gent_compressed - * - * Purpose: Generate a compressed dataset in LOC_ID - * - *------------------------------------------------------------------------- - */ -static void gent_compressed(hid_t loc_id) -{ - hid_t sid, did, pid; - hsize_t dims[1] = {6}; - hsize_t chunk_dims[1] = {2}; - int buf[6] = {1,2,3,4,5,6}; - - /* create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - - /* create property plist for chunk*/ - pid = H5Pcreate(H5P_DATASET_CREATE); - H5Pset_chunk(pid, 1, chunk_dims); - - /* set the deflate filter */ -#if defined (H5_HAVE_FILTER_DEFLATE) - H5Pset_deflate(pid, 1); -#endif - - /* create dataset */ - did = H5Dcreate2(loc_id, DATASET_COMPRESSED, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT); - - /* write */ - H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - - /* close */ - H5Sclose(sid); - H5Dclose(did); - H5Pclose(pid); -} - - -/*------------------------------------------------------------------------- - * Function: gent_named_vl - * - * Purpose: Generate a variable lenght named datatype for a dataset in - LOC_ID - * - *------------------------------------------------------------------------- - */ -static void gent_named_vl(hid_t loc_id) -{ - hid_t sid, did, tid; - hsize_t dims[1] = {2}; - hvl_t buf[2]; - - /* allocate and initialize VL dataset to write */ - buf[0].len = 1; - buf[0].p = malloc( 1 * sizeof(int)); - ((int *)buf[0].p)[0]=1; - buf[1].len = 2; - buf[1].p = malloc( 2 * sizeof(int)); - ((int *)buf[1].p)[0]=2; - ((int *)buf[1].p)[1]=3; - - /* create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - - /* create datatype */ - tid = H5Tvlen_create(H5T_NATIVE_INT); - - /* create named datatype */ - H5Tcommit2(loc_id, "vl", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* create dataset */ - did = H5Dcreate2(loc_id, DATASET_NAMED_VL, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* write */ - H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - - /* close */ - H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf); - H5Sclose(sid); - H5Dclose(did); - H5Tclose(tid); -} - - -/*------------------------------------------------------------------------- - * Function: gent_nested_vl - * - * Purpose: Generate a nested variable length dataset in LOC_ID - * - *------------------------------------------------------------------------- - */ -static void gent_nested_vl(hid_t loc_id) -{ - hid_t sid, did, tid1, tid2; - hsize_t dims[1] = {2}; - hvl_t buf[2]; - hvl_t *tvl; - - /* allocate and initialize VL dataset to write */ - buf[0].len = 1; - buf[0].p = malloc( 1 * sizeof(hvl_t)); - tvl = buf[0].p; - tvl->p = malloc( 1 * sizeof(int) ); - tvl->len = 1; - ((int *)tvl->p)[0]=1; - - buf[1].len = 1; - buf[1].p = malloc( 1 * sizeof(hvl_t)); - tvl = buf[1].p; - tvl->p = malloc( 2 * sizeof(int) ); - tvl->len = 2; - ((int *)tvl->p)[0]=2; - ((int *)tvl->p)[1]=3; - - /* create dataspace */ - sid = H5Screate_simple(1, dims, NULL); - - /* create datatype */ - tid1 = H5Tvlen_create(H5T_NATIVE_INT); - - /* create nested VL datatype */ - tid2 = H5Tvlen_create(tid1); - - /* create dataset */ - did = H5Dcreate2(loc_id, DATASET_NESTED_VL, tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* write */ - H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - - /* close */ - H5Dvlen_reclaim(tid2,sid,H5P_DEFAULT,buf); - H5Sclose(sid); - H5Dclose(did); - H5Tclose(tid1); - H5Tclose(tid2); -} - - -/*------------------------------------------------------------------------- - * Function: gent_datasets - * - * Purpose: Generate all datasets in a particular location - * - *------------------------------------------------------------------------- - */ -static void gent_datasets(hid_t loc_id) -{ - gent_simple(loc_id); - gent_chunked(loc_id); - gent_compact(loc_id); - gent_compound(loc_id); - gent_compressed(loc_id); - gent_named_vl(loc_id); - gent_nested_vl(loc_id); -} - -/*------------------------------------------------------------------------- - * Function: gent_empty_group - * - * Purpose: Generate an empty group in a location - * - *------------------------------------------------------------------------- - */ -static void gent_empty_group(hid_t loc_id) -{ - hid_t gid; - - /* Create group in location */ - gid = H5Gcreate2(loc_id, GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* Release resources */ - H5Gclose(gid); -} - -/*------------------------------------------------------------------------- - * Function: gent_nested_datasets - * - * Purpose: Generate a group in a location and populate it with the "standard" - * datasets - * - *------------------------------------------------------------------------- - */ -static void gent_nested_datasets(hid_t loc_id) -{ - hid_t gid; - - /* Create group in location */ - gid = H5Gcreate2(loc_id, GROUP_DATASETS, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* Add datasets to group created */ - gent_datasets(gid); - - /* Release resources */ - H5Gclose(gid); -} - -/*------------------------------------------------------------------------- - * Function: gent_nested_group - * - * Purpose: Generate a group in a location and populate it with another group - * containing the "standard" datasets - * - *------------------------------------------------------------------------- - */ -static void gent_nested_group(hid_t loc_id) -{ - hid_t gid; - - /* Create group in location */ - gid = H5Gcreate2(loc_id, GROUP_NESTED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* Add datasets to group created */ - gent_nested_datasets(gid); - - /* Release resources */ - H5Gclose(gid); -} - - -/*------------------------------------------------------------------------- - * Function: gen_obj_ref - * - * Purpose: Generate object references to dataset and group - * - * Programmer: Jonathan Kim (Feb 23, 2010) - *------------------------------------------------------------------------*/ -static herr_t gen_obj_ref(hid_t loc_id) -{ - hid_t sid=0, oid=0; - hsize_t dims1[1]={3}; - hsize_t dims2[1]={2}; - int data[3] = {10,20,30}; - int status; - - /*--------------------- - * create obj references to the previously created objects. - * Passing -1 as reference is an object.*/ - hobj_ref_t or_data[2]; /* write buffer */ - herr_t ret = SUCCEED; - - /*-------------- - * add dataset */ - sid = H5Screate_simple(1, dims1, NULL); - if (sid < 0) - { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - oid = H5Dcreate2 (loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (oid < 0) - { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - H5Dclose(oid); - H5Sclose(sid); - - /*-------------- - * add group */ - oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (oid < 0) - { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - H5Gclose(oid); - - status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, -1); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, -1); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - sid = H5Screate_simple (1, dims2, NULL); - if (sid < 0) - { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); - if (oid < 0) - { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - -out: - if(oid > 0) - H5Dclose(oid); - if(sid > 0) - H5Sclose(sid); - - return ret; -} - - -/*------------------------------------------------------------------------- - * Function: gen_region_ref - * - * Purpose: Generate dataset region references - * - * Programmer: Jonathan Kim (Feb 23, 2010) - *------------------------------------------------------------------------*/ -static herr_t gen_region_ref(hid_t loc_id) -{ - hid_t sid=0, oid1=0, oid2=0; - int status; - herr_t ret = SUCCEED; - char data[3][16] = {"The quick brown", "fox jumps over ", "the 5 lazy dogs"}; - hsize_t dims2[2] = {3,16}; - hsize_t coords[4][2] = { {0,1}, {2,11}, {1,0}, {2,4} }; - hdset_reg_ref_t rr_data[2]; - hsize_t start[2] = {0,0}; - hsize_t stride[2] = {2,11}; - hsize_t count[2] = {2,2}; - hsize_t block[2] = {1,3}; - hsize_t dims1[1] = {2}; - - sid = H5Screate_simple (2, dims2, NULL); - if (sid < 0) - { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* create normal dataset which is refered */ - oid2 = H5Dcreate2 (loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); - if (oid2 < 0) - { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* write values to dataset */ - status = H5Dwrite (oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* select elements space for reference */ - status = H5Sselect_elements (sid, H5S_SELECT_SET, 4, coords[0]); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* create region reference from elements space */ - status = H5Rcreate (&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* select hyperslab space for reference */ - status = H5Sselect_hyperslab (sid, H5S_SELECT_SET, start, stride, count, block); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* create region reference from hyperslab space */ - status = H5Rcreate (&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - H5Sclose (sid); - - /* Create dataspace. */ - sid = H5Screate_simple (1, dims1, NULL); - if (sid < 0) - { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* create region reference dataset */ - oid1 = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); - if (oid1 < 0) - { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* write data as region references */ - status = H5Dwrite (oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - -out: - if (oid1 > 0) - H5Dclose (oid1); - if (oid2 > 0) - H5Dclose (oid2); - if (sid > 0) - H5Sclose (sid); - - return ret; -} - -/*------------------------------------------------------------------------- - * Function: Test_Obj_Copy - * - * Purpose: Testing with various objects - * - *------------------------------------------------------------------------*/ -static void Test_Obj_Copy() -{ - hid_t fid=0; - - /* Create source file */ - fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE1); - goto out; - } - - gent_datasets(fid); - gent_empty_group(fid); - gent_nested_datasets(fid); - gent_nested_group(fid); - -out: - /*----------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------*/ - if(fid > 0) - H5Fclose(fid); -} - -/*------------------------------------------------------------------------- - * Function: Test_Ref_Copy - * - * Purpose: Testing with various references - * - *------------------------------------------------------------------------*/ -static void Test_Ref_Copy() -{ - hid_t fid=0; - herr_t status; - - fid = H5Fcreate (HDF_FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2); - goto out; - } - - /* add object reference */ - status = gen_obj_ref(fid); - if (status < 0) - fprintf(stderr, "Failed to generate object reference.\n"); - - /* add region reference */ - status = gen_region_ref(fid); - if (status < 0) - fprintf(stderr, "Failed to generate region reference.\n"); - -out: - /*----------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------*/ - if(fid > 0) - H5Fclose(fid); -} - -/*------------------------------------------------------------------------- - * Function: gen_extlink_trg - * - * Purpose: generate target external link objs - * - * Programmer: Jonathan Kim (March 03, 2010) - *------------------------------------------------------------------------*/ -static herr_t gen_extlink_trg(hid_t loc_id) -{ - hid_t gid=0, tid=0; - int status; - herr_t ret = SUCCEED; - - /*----------------------------------------------------------------------- - * Groups - *------------------------------------------------------------------------*/ - /*-------------- - * target file */ - gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid < 0) - { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /*-------------- - * add dataset */ - gent_simple(loc_id); - - /*-------------------- - * add named datatype - */ - tid = H5Tcopy(H5T_NATIVE_INT); - status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - -out: - if(gid > 0) - H5Gclose(gid); - if(tid > 0) - H5Tclose(tid); - - return ret; -} - -/*------------------------------------------------------------------------- - * Function: gen_extlink_src - * - * Purpose: generate source external link objs - * - * Programmer: Jonathan Kim (March 03, 2010) - *------------------------------------------------------------------------*/ -static herr_t gen_extlink_src(hid_t loc_id) -{ - hid_t gid=0; - int status; - herr_t ret = SUCCEED; - - /*----------------------------------------------------------------------- - * Groups - *------------------------------------------------------------------------*/ - gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (gid < 0) - { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /*----------------------------------------------------------------------- - * External links - *------------------------------------------------------------------------*/ - /* link to dataset */ - status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* link to group */ - status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* link to datatype */ - status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* dangling link - no obj*/ - status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - - /* dangling link - no file */ - status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT); - if (status < 0) - { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); - ret = FAIL; - goto out; - } - -out: - if(gid > 0) - H5Gclose(gid); - - return ret; -} - -/*------------------------------------------------------------------------- - * Function: Test_Extlink_Copy - * - * Purpose: gerenate external link files - * - *------------------------------------------------------------------------*/ -static void Test_Extlink_Copy() -{ - hid_t fid1=0; - hid_t fid2=0; - herr_t status; - - fid1 = H5Fcreate (HDF_EXT_SRC_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE); - goto out; - } - - fid2 = H5Fcreate (HDF_EXT_TRG_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid2 < 0) - { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE); - goto out; - } - - /* add links to source external link file */ - status = gen_extlink_src(fid1); - if (status < 0) - fprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE); - - /* add objs to target external link file */ - status = gen_extlink_trg(fid2); - if (status < 0) - fprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE); - -out: - /*----------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------*/ - if(fid1 > 0) - H5Fclose(fid1); - if(fid2 > 0) - H5Fclose(fid2); -} - -/*------------------------------------------------------------------------- - * Function: main - * - *------------------------------------------------------------------------- - */ - -int main(void) -{ - Test_Obj_Copy(); - Test_Ref_Copy(); - Test_Extlink_Copy(); - - return 0; -} - diff --git a/tools/h5copy/testfiles/h5copy_extlinks_src.h5 b/tools/h5copy/testfiles/h5copy_extlinks_src.h5 Binary files differdeleted file mode 100644 index 7b8621e..0000000 --- a/tools/h5copy/testfiles/h5copy_extlinks_src.h5 +++ /dev/null diff --git a/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls b/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls deleted file mode 100644 index 0134714..0000000 --- a/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls +++ /dev/null @@ -1,43 +0,0 @@ -Opened "./testfiles/h5copy_extlinks_src.out.h5" with sec2 driver. -/ Group - Location: 1:96 - Links: 1 -/copy1_dset Dataset {6/6} - Location: 1:800 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/copy1_group Group - Location: 1:4696 - Links: 1 -/copy1_group/extlink_datatype External Link {h5copy_extlinks_trg.h5//datatype} -/copy1_group/extlink_dset External Link {h5copy_extlinks_trg.h5//simple} -/copy1_group/extlink_grp External Link {h5copy_extlinks_trg.h5//group} -/copy1_group/extlink_notyet1 External Link {h5copy_extlinks_trg.h5//notyet} -/copy1_group/extlink_notyet2 External Link {notyet_file.h5//notyet} -/copy2_dset Dataset {6/6} - Location: 1:4216 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/copy2_group Group - Location: 1:5128 - Links: 1 -/copy2_group/extlink_datatype Type - Location: 1:6328 - Links: 1 - Type: shared-1:6328 32-bit little-endian integer -/copy2_group/extlink_dset Dataset {6/6} - Location: 1:5496 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/copy2_group/extlink_grp Group - Location: 1:6288 - Links: 1 -/copy2_group/extlink_notyet1 External Link {h5copy_extlinks_trg.h5//notyet} -/copy2_group/extlink_notyet2 External Link {notyet_file.h5//notyet} -/copy_dangle1_1 External Link {h5copy_extlinks_trg.h5//notyet} -/copy_dangle1_2 External Link {h5copy_extlinks_trg.h5//notyet} -/copy_dangle2_1 External Link {notyet_file.h5//notyet} -/copy_dangle2_2 External Link {notyet_file.h5//notyet} diff --git a/tools/h5copy/testfiles/h5copy_extlinks_trg.h5 b/tools/h5copy/testfiles/h5copy_extlinks_trg.h5 Binary files differdeleted file mode 100644 index 3a0242d..0000000 --- a/tools/h5copy/testfiles/h5copy_extlinks_trg.h5 +++ /dev/null diff --git a/tools/h5copy/testfiles/h5copy_misc1.out b/tools/h5copy/testfiles/h5copy_misc1.out deleted file mode 100644 index 10dd1a6..0000000 --- a/tools/h5copy/testfiles/h5copy_misc1.out +++ /dev/null @@ -1,3 +0,0 @@ -Copying file <./testfiles/h5copytst.h5> and object </simple> to file <./testfiles/h5copytst.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/testfiles/h5copy_ref.h5 b/tools/h5copy/testfiles/h5copy_ref.h5 Binary files differdeleted file mode 100644 index bd727e6..0000000 --- a/tools/h5copy/testfiles/h5copy_ref.h5 +++ /dev/null diff --git a/tools/h5copy/testfiles/h5copy_ref.out.ls b/tools/h5copy/testfiles/h5copy_ref.out.ls deleted file mode 100644 index 0769dc8..0000000 --- a/tools/h5copy/testfiles/h5copy_ref.out.ls +++ /dev/null @@ -1,31 +0,0 @@ -Opened "./testfiles/h5copy_ref.out.h5" with sec2 driver. -/ Group - Location: 1:96 - Links: 1 -/COPY Group - Location: 1:1464 - Links: 1 -/COPY/Dset1 Dataset {3/3} - Location: 1:1504 - Links: 2 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/COPY/Dset2 Dataset {3/3, 16/16} - Location: 1:1960 - Links: 3 - Storage: <details removed for portability> - Type: 8-bit integer -/COPY/Dset_OBJREF Dataset {2/2} - Location: 1:5184 - Links: 1 - Storage: <details removed for portability> - Type: object reference -/COPY/Dset_REGREF Dataset {2/2} - Location: 1:9400 - Links: 1 - Storage: <details removed for portability> - Type: dataset region reference -/COPY/Group Group - Location: 1:2096 - Links: 3 -/~obj_pointed_by_2096 Group, same as /COPY/Group diff --git a/tools/h5copy/testfiles/h5copytst.h5 b/tools/h5copy/testfiles/h5copytst.h5 Binary files differdeleted file mode 100644 index f407f82..0000000 --- a/tools/h5copy/testfiles/h5copytst.h5 +++ /dev/null diff --git a/tools/h5copy/testfiles/h5copytst.out.ls b/tools/h5copy/testfiles/h5copytst.out.ls deleted file mode 100644 index 62c860b..0000000 --- a/tools/h5copy/testfiles/h5copytst.out.ls +++ /dev/null @@ -1,429 +0,0 @@ -Opened "./testfiles/h5copytst.out.h5" with sec2 driver. -/ Group - Location: 1:96 - Links: 1 -/A Group - Location: 1:88336 - Links: 1 -/A/B1 Group - Location: 1:89040 - Links: 1 -/A/B1/simple Dataset {6/6} - Location: 1:88208 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/A/B2 Group - Location: 1:92576 - Links: 1 -/A/B2/simple2 Dataset {6/6} - Location: 1:92448 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/C Group - Location: 1:95784 - Links: 1 -/C/D Group - Location: 1:96488 - Links: 1 -/C/D/simple Dataset {6/6} - Location: 1:95656 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/E Group - Location: 1:110400 - Links: 1 -/E/F Group - Location: 1:111104 - Links: 1 -/E/F/grp_dsets Group - Location: 1:98600 - Links: 1 -/E/F/grp_dsets/chunk Dataset {6/6} - Location: 1:102784 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/E/F/grp_dsets/compact Dataset {6/6} - Location: 1:103240 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/E/F/grp_dsets/compound Dataset {2/2} - Location: 1:103376 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/E/F/grp_dsets/compressed Dataset {6/6} - Location: 1:105688 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Filter-0: deflate-1 OPT {1} - Type: 32-bit little-endian integer -/E/F/grp_dsets/named_vl Dataset {2/2} - Location: 1:109952 - Links: 1 - Storage: <details removed for portability> - Type: shared-1:110080 variable length of - 32-bit little-endian integer -/E/F/grp_dsets/nested_vl Dataset {2/2} - Location: 1:110128 - Links: 1 - Storage: <details removed for portability> - Type: variable length of - variable length of - 32-bit little-endian integer -/E/F/grp_dsets/simple Dataset {6/6} - Location: 1:110272 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/E/F/grp_dsets/vl Type - Location: 1:110080 - Links: 2 - Type: shared-1:110080 variable length of - 32-bit little-endian integer -/G Group - Location: 1:126048 - Links: 1 -/G/H Group - Location: 1:126752 - Links: 1 -/G/H/grp_nested Group - Location: 1:113128 - Links: 1 -/G/H/grp_nested/grp_dsets Group - Location: 1:113920 - Links: 1 -/G/H/grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:118104 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/G/H/grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:118560 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/G/H/grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:118696 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/G/H/grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:121008 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Filter-0: deflate-1 OPT {1} - Type: 32-bit little-endian integer -/G/H/grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:125272 - Links: 1 - Storage: <details removed for portability> - Type: shared-1:125400 variable length of - 32-bit little-endian integer -/G/H/grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:125448 - Links: 1 - Storage: <details removed for portability> - Type: variable length of - variable length of - 32-bit little-endian integer -/G/H/grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:125592 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/G/H/grp_nested/grp_dsets/vl Type - Location: 1:125400 - Links: 2 - Type: shared-1:125400 variable length of - 32-bit little-endian integer -/chunk Dataset {6/6} - Location: 1:6312 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/compact Dataset {6/6} - Location: 1:6440 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/compound Dataset {2/2} - Location: 1:8624 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/compressed Dataset {6/6} - Location: 1:12984 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Filter-0: deflate-1 OPT {1} - Type: 32-bit little-endian integer -/grp_dsets Group - Location: 1:32160 - Links: 1 -/grp_dsets/chunk Dataset {6/6} - Location: 1:36344 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_dsets/compact Dataset {6/6} - Location: 1:36800 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_dsets/compound Dataset {2/2} - Location: 1:36936 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/grp_dsets/compressed Dataset {6/6} - Location: 1:39248 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Filter-0: deflate-1 OPT {1} - Type: 32-bit little-endian integer -/grp_dsets/named_vl Dataset {2/2} - Location: 1:43512 - Links: 1 - Storage: <details removed for portability> - Type: shared-1:43640 variable length of - 32-bit little-endian integer -/grp_dsets/nested_vl Dataset {2/2} - Location: 1:43688 - Links: 1 - Storage: <details removed for portability> - Type: variable length of - variable length of - 32-bit little-endian integer -/grp_dsets/simple Dataset {6/6} - Location: 1:43832 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_dsets/simple_group Dataset {6/6} - Location: 1:59944 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_dsets/vl Type - Location: 1:43640 - Links: 2 - Type: shared-1:43640 variable length of - 32-bit little-endian integer -/grp_empty Group - Location: 1:31368 - Links: 1 -/grp_nested Group - Location: 1:44624 - Links: 1 -/grp_nested/grp_dsets Group - Location: 1:45416 - Links: 1 -/grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:49600 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:50056 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:50192 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:52504 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Filter-0: deflate-1 OPT {1} - Type: 32-bit little-endian integer -/grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:56768 - Links: 1 - Storage: <details removed for portability> - Type: shared-1:56896 variable length of - 32-bit little-endian integer -/grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:56944 - Links: 1 - Storage: <details removed for portability> - Type: variable length of - variable length of - 32-bit little-endian integer -/grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:57088 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_nested/grp_dsets/vl Type - Location: 1:56896 - Links: 2 - Type: shared-1:56896 variable length of - 32-bit little-endian integer -/grp_rename Group - Location: 1:61152 - Links: 1 -/grp_rename/chunk Dataset {6/6} - Location: 1:65336 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_rename/compact Dataset {6/6} - Location: 1:65792 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_rename/compound Dataset {2/2} - Location: 1:65928 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/grp_rename/compressed Dataset {6/6} - Location: 1:68240 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Filter-0: deflate-1 OPT {1} - Type: 32-bit little-endian integer -/grp_rename/grp_dsets Group - Location: 1:74032 - Links: 1 -/grp_rename/grp_dsets/chunk Dataset {6/6} - Location: 1:78216 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_rename/grp_dsets/compact Dataset {6/6} - Location: 1:78672 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_rename/grp_dsets/compound Dataset {2/2} - Location: 1:78808 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/grp_rename/grp_dsets/compressed Dataset {6/6} - Location: 1:81120 - Links: 1 - Chunks: {2} 8 bytes - Storage: <details removed for portability> - Filter-0: deflate-1 OPT {1} - Type: 32-bit little-endian integer -/grp_rename/grp_dsets/named_vl Dataset {2/2} - Location: 1:85384 - Links: 1 - Storage: <details removed for portability> - Type: shared-1:85512 variable length of - 32-bit little-endian integer -/grp_rename/grp_dsets/nested_vl Dataset {2/2} - Location: 1:85560 - Links: 1 - Storage: <details removed for portability> - Type: variable length of - variable length of - 32-bit little-endian integer -/grp_rename/grp_dsets/simple Dataset {6/6} - Location: 1:85704 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_rename/grp_dsets/vl Type - Location: 1:85512 - Links: 2 - Type: shared-1:85512 variable length of - 32-bit little-endian integer -/grp_rename/named_vl Dataset {2/2} - Location: 1:72504 - Links: 1 - Storage: <details removed for portability> - Type: shared-1:72632 variable length of - 32-bit little-endian integer -/grp_rename/nested_vl Dataset {2/2} - Location: 1:72680 - Links: 1 - Storage: <details removed for portability> - Type: variable length of - variable length of - 32-bit little-endian integer -/grp_rename/simple Dataset {6/6} - Location: 1:72824 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/grp_rename/vl Type - Location: 1:72632 - Links: 2 - Type: shared-1:72632 variable length of - 32-bit little-endian integer -/named_vl Dataset {2/2} - Location: 1:19296 - Links: 1 - Storage: <details removed for portability> - Type: shared-1:19424 variable length of - 32-bit little-endian integer -/nested_vl Dataset {2/2} - Location: 1:25792 - Links: 1 - Storage: <details removed for portability> - Type: variable length of - variable length of - 32-bit little-endian integer -/rename Dataset {2/2} - Location: 1:30160 - Links: 1 - Storage: <details removed for portability> - Type: struct { - "str1" +0 20-byte null-terminated ASCII string - "str2" +20 20-byte null-terminated ASCII string - } 40 bytes -/simple Dataset {6/6} - Location: 1:800 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer -/simple_top Dataset {6/6} - Location: 1:27984 - Links: 1 - Storage: <details removed for portability> - Type: 32-bit little-endian integer diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh deleted file mode 100644 index 0529d53..0000000 --- a/tools/h5copy/testh5copy.sh +++ /dev/null @@ -1,548 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. -# -# Tests for the h5copy tool -# -# Pedro Vicente Nunes (pvn@hdfgroup.org), Albert Cheng (acheng@hdfgroup.org) -# Thursday, July 20, 2006 -# - -# The build (current) directory might be different than the source directory. -if test -z "$srcdir"; then - srcdir=. -fi - -# source dirs -SRC_TOOLS="$srcdir/.." -SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" -# testfiles source dirs for tools -SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" -SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" -SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" -SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" -SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" -SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" -SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" -SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" - -TESTNAME=h5copy -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -###################################################################### -# test files -# -------------------------------------------------------------------- -# All the test files copy from source directory to test directory -# NOTE: Keep this framework to add/remove test files. -# Any test files from other tools can be used in this framework. -# This list are also used for checking exist. -# Comment '#' without space can be used. -# -------------------------------------------------------------------- -# List of files that will be copied over to local test dir -LIST_HDF5_TEST_FILES=" -$SRC_H5COPY_TESTFILES/h5copytst.h5 -$SRC_H5COPY_TESTFILES/h5copy_ref.h5 -$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.h5 -$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 -" - -H5COPY=h5copy # The tool name -H5COPY_BIN=`pwd`/$H5COPY # The path of the tool binary -H5DIFF=h5diff # The h5diff tool name -H5DIFF_BIN=`pwd`/../h5diff/$H5DIFF # The path of the h5diff tool binary -H5LS=h5ls # The h5ls tool name -H5LS_ARGS=-Svr # Arguments to the h5ls tool -H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary -CMP='cmp -s' -DIFF='diff -c' -CP='cp' - -nerrors=0 -verbose=yes -h5haveexitcode=yes # default is yes - -TESTDIR=./testfiles -test -d $TESTDIR || mkdir $TESTDIR - -# RUNSERIAL is used. Check if it can return exit code from executalbe correctly. -if [ -n "$RUNSERIAL_NOEXITCODE" ]; then - echo "***Warning*** Serial Exit Code is not passed back to shell corretly." - echo "***Warning*** Exit code checking is skipped." - h5haveexitcode=no -fi - -# -# copy test files and expected output files from source dirs to test dir -# -COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES" - -COPY_TESTFILES_TO_TESTDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_TESTFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - if [ -a $tstfile ]; then - $CP -f $tstfile $TESTDIR - else - echo "Error: FAILED to copy $tstfile." - echo " $tstfile doesn't exist!" - exit $EXIT_FAILURE - fi - fi - done -} - -# Print a "SKIP" message -SKIP() { - TESTING $H5COPY $@ - echo " -SKIP-" -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -TESTING() -{ - SPACES=" " - echo "Testing $* $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() -{ - SPACES=" " - echo "Verifying h5diff output $* $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_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=" " - echo "Verifying output files $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# Source in the output filter function definitions. -. $srcdir/../../bin/output_filter.sh - -# Run a test and print PASS or *FAIL*. If h5copy can complete -# with exit status 0, consider it pass. If a test fails then increment -# the `nerrors' global variable. -# Assumed arguments: -# $1 is -i -# $2 is input file -# $3 is -o -# $4 is output file -# $* everything else arguments for h5copy. - -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 - - TESTING $H5COPY $@ - ( - echo "#############################" - echo " output for '$H5COPY $@'" - echo "#############################" - $RUNSERIAL $H5COPY_BIN $@ - ) > $actualout 2> $actualerr - RET=$? - if [ $RET != 0 ]; then - echo "*FAILED*" - echo "failed result is:" - cat $actualout - nerrors="`expr $nerrors + 1`" - else - echo " PASSED" - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr - fi - fi - - if [ $runh5diff != no ]; then - H5DIFFTEST $inputfile $outputfile $7 $9 - fi -} - - -# Compare the two text files -# PASS if same -# FAIL if different, and show the diff -# -# Assumed arguments: -# $1 is text file1 (expected output) -# $2 is text file2 (actual output) -CMP_OUTPUT() -{ - expect=$1 - actual=$2 - - VERIFY_OUTPUT $@ - 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 output differs from actual output" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi -} - -TOOLTEST_FAIL() -{ - expectout="$TESTDIR/$1" - actualout="$TESTDIR/$1.actualout" - actualerr="$TESTDIR/$1.actualerr" - actualout_sav=${actualout}-sav - actualerr_sav=${actualerr}-sav - shift - if [ "$1" = -i ]; then - inputfile=$2 - fi - if [ "$3" = -o ]; then - outputfile=$4 - fi - - TESTING $H5COPY $@ - ( - #echo "#############################" - #echo " output for '$H5COPY $@'" - #echo "#############################" - $RUNSERIAL $H5COPY_BIN $@ - ) > $actualout 2> $actualerr - - RET=$? - # save actualout and actualerr in case they are needed later. - cp $actualout $actualout_sav - STDOUT_FILTER $actualout - cp $actualerr $actualerr_sav - STDERR_FILTER $actualerr - if [ $RET != 0 ]; then - echo " PASSED" - # Verifying output text from h5copy - if [ "$expectout" != "SKIP" ]; then - # combine stderr to stdout to compare the output at once. - # We may seperate stdout and stderr later. - cat $actualerr >> $actualout - CMP_OUTPUT $expectout $actualout - fi - else - echo "*FAILED*" - echo "failed result is:" - cat $actualout - nerrors="`expr $nerrors + 1`" - fi - - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr $actualout_sav $actualerr_sav - fi -} - - -# Call the h5diff tool -# -H5DIFFTEST() -{ - VERIFY $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" - RET=$? - if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - else - echo " PASSED" - fi -} - -# Call the h5diff tool with a call that is expected to fail -# -H5DIFFTEST_FAIL() -{ - VERIFY $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" - RET=$? - - if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - else - 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 -# -# Assumed arguments: -# <none> -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 - - 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 - - echo "Test copying & renaming dataset" - TOOLTEST -i $TESTFILE -o $FILEOUT -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 - - 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 - - echo "Test copying & renaming group" - TOOLTEST -i $TESTFILE -o $FILEOUT -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 - - 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 -} - -# 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 -} - -# Copy external links. -# adding to the destination file each time compare the result -# -# Assumed arguments: -# <none> -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 - - 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 - - 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 - - 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 - - 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 - - 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 - - echo "Test copying a group contains external links without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -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 -} - -# Test misc. -# -# Assumed arguments: -# <none> -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 - - 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 -} - -############################################################################## -### T H E T E S T S ### -############################################################################## -# prepare for test -COPY_TESTFILES_TO_TESTDIR - -# Start tests -COPY_OBJECTS -COPY_REFERENCES -COPY_EXT_LINKS -TEST_MISC - - -if test $nerrors -eq 0 ; then - echo "All $TESTNAME tests passed." - exit $EXIT_SUCCESS -else - echo "$TESTNAME tests failed with $nerrors errors." - exit $EXIT_FAILURE -fi |
