summaryrefslogtreecommitdiffstats
path: root/tools/h5copy/testh5copy.sh
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2010-03-09 21:46:00 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2010-03-09 21:46:00 (GMT)
commit5345e2394effb206c1f76c95a1eddb937e34a316 (patch)
treeb63c0c0c99000f86b57b11178ae7fbb5417fd6d1 /tools/h5copy/testh5copy.sh
parent8833db1c5bc4ea2542781751ca5a9a3657ee5fff (diff)
downloadhdf5-5345e2394effb206c1f76c95a1eddb937e34a316.zip
hdf5-5345e2394effb206c1f76c95a1eddb937e34a316.tar.gz
hdf5-5345e2394effb206c1f76c95a1eddb937e34a316.tar.bz2
[svn-r18400] Purpose:
add test cases for h5copy - copy external links with/without ‘–f ext’ option (relate to bug 1733) Description: merged from hdf5 trunk (r18398 and r18399) Tested: jam
Diffstat (limited to 'tools/h5copy/testh5copy.sh')
-rw-r--r--tools/h5copy/testh5copy.sh61
1 files changed, 60 insertions, 1 deletions
diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh
index bc19505..d8dfe52 100644
--- a/tools/h5copy/testh5copy.sh
+++ b/tools/h5copy/testh5copy.sh
@@ -26,6 +26,8 @@ EXIT_FAILURE=1
# Test files
HDF_FILE1=h5copytst.h5
HDF_FILE2=h5copy_ref.h5
+HDF_EXT_SRC_FILE=h5copy_extlinks_src.h5
+HDF_EXT_TRG_FILE=h5copy_extlinks_trg.h5
H5COPY=h5copy # The tool name
H5COPY_BIN=`pwd`/$H5COPY # The path of the tool binary
@@ -49,6 +51,12 @@ OUTDIR=./testfiles
test -d $OUTDIR || mkdir $OUTDIR
+# 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()
@@ -313,7 +321,6 @@ COPY_REFERENCES()
rm -f $FILEOUT
echo "Test copying object and region references"
- echo "TOOLTEST -f ref -i $TESTFILE -o $FILEOUT -v -s / -d /COPY"
TOOLTEST -f ref -i $TESTFILE -o $FILEOUT -v -s / -d /COPY
# Verify that the file created above is correct
@@ -326,12 +333,64 @@ COPY_REFERENCES()
fi
}
+# Copy external links.
+# adding to the destination file each time compare the result
+#
+# Assumed arguments:
+# <none>
+COPY_EXT_LINKS()
+{
+ TESTFILE="$INDIR/$HDF_EXT_SRC_FILE"
+ FILEOUT="$OUTDIR/`basename $HDF_EXT_SRC_FILE .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 -i $TESTFILE -o $FILEOUT -v -s /copy2_group/extlink_notyet1 -d /copy2_dangle1
+ SKIP -s /copy2_group/extlink_notyet1 -d /copy2_dangle1
+
+ echo "Test copying dangling external link (no obj) directly with -f ext"
+ #TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /copy2_group/extlink_notyet1 -d /copy2_dangle1
+ SKIP -f ext -s /copy2_group/extlink_notyet1 -d /copy2_dangle1
+
+ echo "Test copying dangling external link (no file) directly without -f ext"
+ #TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /copy2_group/extlink_notyet2 -d /copy2_dangle2
+ SKIP -s /copy2_group/extlink_notyet2 -d /copy2_dangle2
+
+ echo "Test copying dangling external link (no file) directly with -f ext"
+ #TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /copy2_group/extlink_notyet2 -d /copy2_dangle2
+ SKIP -f ext -s /copy2_group/extlink_notyet2 -d /copy2_dangle2
+
+ 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 -i $TESTFILE -o $FILEOUT -v -f ext -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
+}
+
##############################################################################
### T H E T E S T S ###
##############################################################################
COPY_OBJECTS
COPY_REFERENCES
+COPY_EXT_LINKS
if test $nerrors -eq 0 ; then