summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/h5copy/CMakeLists.txt11
-rw-r--r--tools/h5copy/testfiles/h5copy_misc1.out2
-rw-r--r--tools/h5copy/testh5copy.sh116
-rwxr-xr-xtools/h5diff/testh5diff.sh602
-rw-r--r--tools/h5dump/testh5dump.sh.in478
-rwxr-xr-xtools/h5import/h5importtestutil.sh144
-rw-r--r--tools/h5jam/testh5jam.sh.in248
-rw-r--r--tools/h5ls/testh5ls.sh.in143
-rwxr-xr-xtools/h5repack/h5repack.sh.in334
-rw-r--r--tools/h5stat/testh5stat.sh.in85
10 files changed, 1637 insertions, 526 deletions
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt
index 489ac90..11cebca 100644
--- a/tools/h5copy/CMakeLists.txt
+++ b/tools/h5copy/CMakeLists.txt
@@ -70,13 +70,6 @@ IF (BUILD_TESTING)
)
ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES})
- ADD_CUSTOM_COMMAND (
- TARGET h5copy
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ${PROJECT_BINARY_DIR}/h5copytst.h5
- )
-
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -159,7 +152,7 @@ IF (BUILD_TESTING)
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 ${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
+ ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${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")
@@ -168,7 +161,7 @@ IF (BUILD_TESTING)
NAME H5COPY-CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy>"
- -D "TEST_ARGS=-i;${infile};-o;./testfiles/${outfile};${vparam};${sparam};${srcname};${dparam};${dstname}"
+ -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}"
diff --git a/tools/h5copy/testfiles/h5copy_misc1.out b/tools/h5copy/testfiles/h5copy_misc1.out
index 370b1a5..10dd1a6 100644
--- a/tools/h5copy/testfiles/h5copy_misc1.out
+++ b/tools/h5copy/testfiles/h5copy_misc1.out
@@ -1,3 +1,3 @@
-Copying file <h5copytst.h5> and object </simple> to file <./testfiles/h5copytst.out.h5> and object </g1/g2/simple>
+Copying file <./testfiles/h5copytst.h5> and object </simple> to file <./testfiles/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/testh5copy.sh b/tools/h5copy/testh5copy.sh
index 1dbb03c..65cd353 100644
--- a/tools/h5copy/testh5copy.sh
+++ b/tools/h5copy/testh5copy.sh
@@ -19,6 +19,24 @@
# 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
@@ -29,6 +47,31 @@ HDF_FILE2=h5copy_ref.h5
HDF_EXT_SRC_FILE=h5copy_extlinks_src.h5
HDF_EXT_TRG_FILE=h5copy_extlinks_trg.h5
+######################################################################
+# 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/$HDF_FILE1
+$SRC_H5COPY_TESTFILES/$HDF_FILE2
+$SRC_H5COPY_TESTFILES/$HDF_EXT_SRC_FILE
+$SRC_H5COPY_TESTFILES/$HDF_EXT_TRG_FILE
+"
+
+# 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
@@ -38,19 +81,14 @@ 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
-# The build (current) directory might be different than the source directory.
-if test -z "$srcdir"; then
- srcdir=.
-fi
-INDIR=$srcdir/testfiles
-OUTDIR=./testfiles
-
-test -d $OUTDIR || mkdir $OUTDIR
+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
@@ -59,6 +97,31 @@ if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
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 $@
@@ -115,6 +178,8 @@ VERIFY_OUTPUT()
TOOLTEST()
{
+ actualout="$TESTDIR/tooltest.actualout"
+ actualerr="$TESTDIR/tooltest.actualerr"
runh5diff=yes
if [ "$1" = -i ]; then
inputfile=$2
@@ -133,19 +198,19 @@ TOOLTEST()
echo " output for '$H5COPY $@'"
echo "#############################"
$RUNSERIAL $H5COPY_BIN $@
- ) > output.out
+ ) > $actualout 2> $actualerr
RET=$?
if [ $RET != 0 ]; then
echo "*FAILED*"
echo "failed result is:"
- cat output.out
+ cat $actualout
nerrors="`expr $nerrors + 1`"
else
echo " PASSED"
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- rm -f output.out
+ rm -f $actualout $actualerr
fi
fi
@@ -184,9 +249,9 @@ CMP_OUTPUT()
TOOLTEST_FAIL()
{
- expectout="$INDIR/$1"
- actualout="$OUTDIR/$1.out"
- actualerr="$OUTDIR/$1.err"
+ expectout="$TESTDIR/$1"
+ actualout="$TESTDIR/$1.actualout"
+ actualerr="$TESTDIR/$1.actualerr"
actualout_sav=${actualout}-sav
actualerr_sav=${actualerr}-sav
shift
@@ -270,8 +335,8 @@ H5DIFFTEST_FAIL()
#
H5LSTEST()
{
- expect="$INDIR/`basename $1 .h5`.ls"
- actual="$OUTDIR/`basename $1 .h5`.out"
+ 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.
@@ -313,8 +378,8 @@ H5LSTEST()
# <none>
COPY_OBJECTS()
{
- TESTFILE="$INDIR/$HDF_FILE1"
- FILEOUT="$OUTDIR/`basename $HDF_FILE1 .h5`.out.h5"
+ TESTFILE="$TESTDIR/$HDF_FILE1"
+ FILEOUT="$TESTDIR/`basename $HDF_FILE1 .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -373,8 +438,8 @@ COPY_OBJECTS()
# <none>
COPY_REFERENCES()
{
- TESTFILE="$INDIR/$HDF_FILE2"
- FILEOUT="$OUTDIR/`basename $HDF_FILE2 .h5`.out.h5"
+ TESTFILE="$TESTDIR/$HDF_FILE2"
+ FILEOUT="$TESTDIR/`basename $HDF_FILE2 .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -399,8 +464,8 @@ COPY_REFERENCES()
# <none>
COPY_EXT_LINKS()
{
- TESTFILE="$INDIR/$HDF_EXT_SRC_FILE"
- FILEOUT="$OUTDIR/`basename $HDF_EXT_SRC_FILE .h5`.out.h5"
+ TESTFILE="$TESTDIR/$HDF_EXT_SRC_FILE"
+ FILEOUT="$TESTDIR/`basename $HDF_EXT_SRC_FILE .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -445,8 +510,8 @@ COPY_EXT_LINKS()
# <none>
TEST_MISC()
{
- TESTFILE="$HDF_FILE1"
- FILEOUT="$OUTDIR/`basename $HDF_FILE1 .h5`.out.h5"
+ TESTFILE="$TESTDIR/$HDF_FILE1"
+ FILEOUT="$TESTDIR/`basename $HDF_FILE1 .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -473,7 +538,10 @@ TEST_MISC()
##############################################################################
### T H E T E S T S ###
##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
+# Start tests
COPY_OBJECTS
COPY_REFERENCES
COPY_EXT_LINKS
diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh
index 7803022..1b6ed5a 100755
--- a/tools/h5diff/testh5diff.sh
+++ b/tools/h5diff/testh5diff.sh
@@ -30,54 +30,6 @@
# Added test 450 - 459 (dangling links)
-###############################################################################
-## test file names
-###############################################################################
-
-FILE1=h5diff_basic1.h5
-FILE2=h5diff_basic2.h5
-FILE3=h5diff_types.h5
-FILE4=h5diff_dtypes.h5
-FILE5=h5diff_attr1.h5
-FILE6=h5diff_attr2.h5
-FILE7=h5diff_dset1.h5
-FILE8=h5diff_dset2.h5
-FILE9=h5diff_hyper1.h5
-FILE10=h5diff_hyper2.h5
-FILE11=h5diff_empty.h5
-FILE12=h5diff_links.h5
-FILE13=h5diff_softlinks.h5
-FILE14=h5diff_linked_softlink.h5
-FILE15=h5diff_extlink_src.h5
-FILE16=h5diff_extlink_trg.h5
-FILE17=h5diff_ext2softlink_src.h5
-FILE18=h5diff_ext2softlink_trg.h5
-FILE19=h5diff_dset_zero_dim_size1.h5
-FILE20=h5diff_dset_zero_dim_size2.h5
-DANGLE_LINK_FILE1=h5diff_danglelinks1.h5
-DANGLE_LINK_FILE2=h5diff_danglelinks2.h5
-# group recursive
-GRP_RECURSE_FILE1=h5diff_grp_recurse1.h5
-GRP_RECURSE_FILE2=h5diff_grp_recurse2.h5
-# group recursive - same structure via external links through files
-GRP_RECURSE1_EXT=h5diff_grp_recurse_ext1.h5
-GRP_RECURSE2_EXT1=h5diff_grp_recurse_ext2-1.h5
-GRP_RECURSE2_EXT2=h5diff_grp_recurse_ext2-2.h5
-GRP_RECURSE2_EXT3=h5diff_grp_recurse_ext2-3.h5
-# same structure, same obj name with different value
-EXCLUDE_FILE1_1=h5diff_exclude1-1.h5
-EXCLUDE_FILE1_2=h5diff_exclude1-2.h5
-# different structure and obj names
-EXCLUDE_FILE2_1=h5diff_exclude2-1.h5
-EXCLUDE_FILE2_2=h5diff_exclude2-2.h5
-# compound type with multiple vlen string types
-COMP_VL_STRS_FILE=h5diff_comp_vl_strs.h5
-
-ATTR_VERBOSE_LEVEL_FILE1=h5diff_attr_v_level1.h5
-ATTR_VERBOSE_LEVEL_FILE2=h5diff_attr_v_level2.h5
-
-# test enum types which may have invalid values
-ENUM_INVALID_VALUES=h5diff_enum_invalid_values.h5
TESTNAME=h5diff
EXIT_SUCCESS=0
@@ -88,6 +40,7 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
+CP='cp'
nerrors=0
verbose=yes
@@ -100,7 +53,247 @@ if test -z "$srcdir"; then
srcdir=.
fi
-test -d ./testfiles || mkdir ./testfiles
+# 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"
+
+TESTDIR=./testfiles
+test -d $TESTDIR || mkdir $TESTDIR
+
+######################################################################
+# 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_HDF5_TEST_FILES="
+$SRC_H5DIFF_TESTFILES/h5diff_basic1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_basic2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_types.h5
+$SRC_H5DIFF_TESTFILES/h5diff_dtypes.h5
+$SRC_H5DIFF_TESTFILES/h5diff_attr1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_attr2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_dset1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_dset2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_hyper1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_hyper2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_empty.h5
+$SRC_H5DIFF_TESTFILES/h5diff_links.h5
+$SRC_H5DIFF_TESTFILES/h5diff_softlinks.h5
+$SRC_H5DIFF_TESTFILES/h5diff_linked_softlink.h5
+$SRC_H5DIFF_TESTFILES/h5diff_extlink_src.h5
+$SRC_H5DIFF_TESTFILES/h5diff_extlink_trg.h5
+$SRC_H5DIFF_TESTFILES/h5diff_ext2softlink_src.h5
+$SRC_H5DIFF_TESTFILES/h5diff_ext2softlink_trg.h5
+$SRC_H5DIFF_TESTFILES/h5diff_dset_zero_dim_size1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_dset_zero_dim_size2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_danglelinks1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_danglelinks2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext2-1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext2-2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext2-3.h5
+$SRC_H5DIFF_TESTFILES/h5diff_exclude1-1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_exclude1-2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_exclude2-1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_exclude2-2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_comp_vl_strs.h5
+$SRC_H5DIFF_TESTFILES/h5diff_attr_v_level1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5DIFF_TESTFILES/h5diff_10.txt
+$SRC_H5DIFF_TESTFILES/h5diff_100.txt
+$SRC_H5DIFF_TESTFILES/h5diff_101.txt
+$SRC_H5DIFF_TESTFILES/h5diff_102.txt
+$SRC_H5DIFF_TESTFILES/h5diff_103.txt
+$SRC_H5DIFF_TESTFILES/h5diff_104.txt
+$SRC_H5DIFF_TESTFILES/h5diff_11.txt
+$SRC_H5DIFF_TESTFILES/h5diff_12.txt
+$SRC_H5DIFF_TESTFILES/h5diff_13.txt
+$SRC_H5DIFF_TESTFILES/h5diff_14.txt
+$SRC_H5DIFF_TESTFILES/h5diff_15.txt
+$SRC_H5DIFF_TESTFILES/h5diff_16_1.txt
+$SRC_H5DIFF_TESTFILES/h5diff_16_2.txt
+$SRC_H5DIFF_TESTFILES/h5diff_16_3.txt
+$SRC_H5DIFF_TESTFILES/h5diff_17.txt
+$SRC_H5DIFF_TESTFILES/h5diff_171.txt
+$SRC_H5DIFF_TESTFILES/h5diff_172.txt
+$SRC_H5DIFF_TESTFILES/h5diff_18_1.txt
+$SRC_H5DIFF_TESTFILES/h5diff_18.txt
+$SRC_H5DIFF_TESTFILES/h5diff_20.txt
+$SRC_H5DIFF_TESTFILES/h5diff_200.txt
+$SRC_H5DIFF_TESTFILES/h5diff_201.txt
+$SRC_H5DIFF_TESTFILES/h5diff_202.txt
+$SRC_H5DIFF_TESTFILES/h5diff_203.txt
+$SRC_H5DIFF_TESTFILES/h5diff_204.txt
+$SRC_H5DIFF_TESTFILES/h5diff_205.txt
+$SRC_H5DIFF_TESTFILES/h5diff_206.txt
+$SRC_H5DIFF_TESTFILES/h5diff_207.txt
+$SRC_H5DIFF_TESTFILES/h5diff_208.txt
+$SRC_H5DIFF_TESTFILES/h5diff_21.txt
+$SRC_H5DIFF_TESTFILES/h5diff_22.txt
+$SRC_H5DIFF_TESTFILES/h5diff_23.txt
+$SRC_H5DIFF_TESTFILES/h5diff_24.txt
+$SRC_H5DIFF_TESTFILES/h5diff_25.txt
+$SRC_H5DIFF_TESTFILES/h5diff_26.txt
+$SRC_H5DIFF_TESTFILES/h5diff_27.txt
+$SRC_H5DIFF_TESTFILES/h5diff_28.txt
+$SRC_H5DIFF_TESTFILES/h5diff_30.txt
+$SRC_H5DIFF_TESTFILES/h5diff_300.txt
+$SRC_H5DIFF_TESTFILES/h5diff_400.txt
+$SRC_H5DIFF_TESTFILES/h5diff_401.txt
+$SRC_H5DIFF_TESTFILES/h5diff_402.txt
+$SRC_H5DIFF_TESTFILES/h5diff_403.txt
+$SRC_H5DIFF_TESTFILES/h5diff_404.txt
+$SRC_H5DIFF_TESTFILES/h5diff_405.txt
+$SRC_H5DIFF_TESTFILES/h5diff_406.txt
+$SRC_H5DIFF_TESTFILES/h5diff_407.txt
+$SRC_H5DIFF_TESTFILES/h5diff_408.txt
+$SRC_H5DIFF_TESTFILES/h5diff_409.txt
+$SRC_H5DIFF_TESTFILES/h5diff_410.txt
+$SRC_H5DIFF_TESTFILES/h5diff_411.txt
+$SRC_H5DIFF_TESTFILES/h5diff_412.txt
+$SRC_H5DIFF_TESTFILES/h5diff_413.txt
+$SRC_H5DIFF_TESTFILES/h5diff_414.txt
+$SRC_H5DIFF_TESTFILES/h5diff_415.txt
+$SRC_H5DIFF_TESTFILES/h5diff_416.txt
+$SRC_H5DIFF_TESTFILES/h5diff_417.txt
+$SRC_H5DIFF_TESTFILES/h5diff_418.txt
+$SRC_H5DIFF_TESTFILES/h5diff_419.txt
+$SRC_H5DIFF_TESTFILES/h5diff_420.txt
+$SRC_H5DIFF_TESTFILES/h5diff_421.txt
+$SRC_H5DIFF_TESTFILES/h5diff_422.txt
+$SRC_H5DIFF_TESTFILES/h5diff_423.txt
+$SRC_H5DIFF_TESTFILES/h5diff_424.txt
+$SRC_H5DIFF_TESTFILES/h5diff_425.txt
+$SRC_H5DIFF_TESTFILES/h5diff_450.txt
+$SRC_H5DIFF_TESTFILES/h5diff_451.txt
+$SRC_H5DIFF_TESTFILES/h5diff_452.txt
+$SRC_H5DIFF_TESTFILES/h5diff_453.txt
+$SRC_H5DIFF_TESTFILES/h5diff_454.txt
+$SRC_H5DIFF_TESTFILES/h5diff_455.txt
+$SRC_H5DIFF_TESTFILES/h5diff_456.txt
+$SRC_H5DIFF_TESTFILES/h5diff_457.txt
+$SRC_H5DIFF_TESTFILES/h5diff_458.txt
+$SRC_H5DIFF_TESTFILES/h5diff_459.txt
+$SRC_H5DIFF_TESTFILES/h5diff_480.txt
+$SRC_H5DIFF_TESTFILES/h5diff_481.txt
+$SRC_H5DIFF_TESTFILES/h5diff_482.txt
+$SRC_H5DIFF_TESTFILES/h5diff_483.txt
+$SRC_H5DIFF_TESTFILES/h5diff_484.txt
+$SRC_H5DIFF_TESTFILES/h5diff_50.txt
+$SRC_H5DIFF_TESTFILES/h5diff_51.txt
+$SRC_H5DIFF_TESTFILES/h5diff_52.txt
+$SRC_H5DIFF_TESTFILES/h5diff_53.txt
+$SRC_H5DIFF_TESTFILES/h5diff_54.txt
+$SRC_H5DIFF_TESTFILES/h5diff_55.txt
+$SRC_H5DIFF_TESTFILES/h5diff_56.txt
+$SRC_H5DIFF_TESTFILES/h5diff_57.txt
+$SRC_H5DIFF_TESTFILES/h5diff_58.txt
+$SRC_H5DIFF_TESTFILES/h5diff_500.txt
+$SRC_H5DIFF_TESTFILES/h5diff_501.txt
+$SRC_H5DIFF_TESTFILES/h5diff_502.txt
+$SRC_H5DIFF_TESTFILES/h5diff_503.txt
+$SRC_H5DIFF_TESTFILES/h5diff_504.txt
+$SRC_H5DIFF_TESTFILES/h5diff_505.txt
+$SRC_H5DIFF_TESTFILES/h5diff_506.txt
+$SRC_H5DIFF_TESTFILES/h5diff_507.txt
+$SRC_H5DIFF_TESTFILES/h5diff_508.txt
+$SRC_H5DIFF_TESTFILES/h5diff_509.txt
+$SRC_H5DIFF_TESTFILES/h5diff_510.txt
+$SRC_H5DIFF_TESTFILES/h5diff_511.txt
+$SRC_H5DIFF_TESTFILES/h5diff_512.txt
+$SRC_H5DIFF_TESTFILES/h5diff_513.txt
+$SRC_H5DIFF_TESTFILES/h5diff_514.txt
+$SRC_H5DIFF_TESTFILES/h5diff_515.txt
+$SRC_H5DIFF_TESTFILES/h5diff_516.txt
+$SRC_H5DIFF_TESTFILES/h5diff_517.txt
+$SRC_H5DIFF_TESTFILES/h5diff_518.txt
+$SRC_H5DIFF_TESTFILES/h5diff_530.txt
+$SRC_H5DIFF_TESTFILES/h5diff_600.txt
+$SRC_H5DIFF_TESTFILES/h5diff_601.txt
+$SRC_H5DIFF_TESTFILES/h5diff_603.txt
+$SRC_H5DIFF_TESTFILES/h5diff_604.txt
+$SRC_H5DIFF_TESTFILES/h5diff_605.txt
+$SRC_H5DIFF_TESTFILES/h5diff_606.txt
+$SRC_H5DIFF_TESTFILES/h5diff_607.txt
+$SRC_H5DIFF_TESTFILES/h5diff_608.txt
+$SRC_H5DIFF_TESTFILES/h5diff_609.txt
+$SRC_H5DIFF_TESTFILES/h5diff_610.txt
+$SRC_H5DIFF_TESTFILES/h5diff_612.txt
+$SRC_H5DIFF_TESTFILES/h5diff_613.txt
+$SRC_H5DIFF_TESTFILES/h5diff_614.txt
+$SRC_H5DIFF_TESTFILES/h5diff_615.txt
+$SRC_H5DIFF_TESTFILES/h5diff_616.txt
+$SRC_H5DIFF_TESTFILES/h5diff_617.txt
+$SRC_H5DIFF_TESTFILES/h5diff_618.txt
+$SRC_H5DIFF_TESTFILES/h5diff_619.txt
+$SRC_H5DIFF_TESTFILES/h5diff_621.txt
+$SRC_H5DIFF_TESTFILES/h5diff_622.txt
+$SRC_H5DIFF_TESTFILES/h5diff_623.txt
+$SRC_H5DIFF_TESTFILES/h5diff_624.txt
+$SRC_H5DIFF_TESTFILES/h5diff_625.txt
+$SRC_H5DIFF_TESTFILES/h5diff_626.txt
+$SRC_H5DIFF_TESTFILES/h5diff_627.txt
+$SRC_H5DIFF_TESTFILES/h5diff_628.txt
+$SRC_H5DIFF_TESTFILES/h5diff_629.txt
+$SRC_H5DIFF_TESTFILES/h5diff_70.txt
+$SRC_H5DIFF_TESTFILES/h5diff_700.txt
+$SRC_H5DIFF_TESTFILES/h5diff_701.txt
+$SRC_H5DIFF_TESTFILES/h5diff_702.txt
+$SRC_H5DIFF_TESTFILES/h5diff_703.txt
+$SRC_H5DIFF_TESTFILES/h5diff_704.txt
+$SRC_H5DIFF_TESTFILES/h5diff_705.txt
+$SRC_H5DIFF_TESTFILES/h5diff_706.txt
+$SRC_H5DIFF_TESTFILES/h5diff_707.txt
+$SRC_H5DIFF_TESTFILES/h5diff_708.txt
+$SRC_H5DIFF_TESTFILES/h5diff_709.txt
+$SRC_H5DIFF_TESTFILES/h5diff_710.txt
+$SRC_H5DIFF_TESTFILES/h5diff_80.txt
+$SRC_H5DIFF_TESTFILES/h5diff_90.txt
+"
+
+#
+# copy test files and expected output files from source dirs to test dir
+#
+COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML"
+
+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
+}
# Parse option
# -p run ph5diff tests
@@ -160,9 +353,9 @@ TESTING() {
# that throws the shell script off.
#
TOOLTEST() {
- expect="$srcdir/testfiles/$1"
- actual="./testfiles/`basename $1 .txt`.out"
- actual_err="./testfiles/`basename $1 .txt`.err"
+ expect="$TESTDIR/$1"
+ actual="$TESTDIR/`basename $1 .txt`.out"
+ actual_err="$TESTDIR/`basename $1 .txt`.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -178,7 +371,7 @@ TOOLTEST() {
#echo "#############################"
#echo "Expected output for '$H5DIFF $@'"
#echo "#############################"
- cd $srcdir/testfiles
+ cd $TESTDIR
eval $RUNCMD $H5DIFF_BIN "$@"
) >$actual 2>$actual_err
EXIT_CODE=$?
@@ -260,6 +453,8 @@ SKIP() {
# is done first in
# TESTING with the name only of the test file $TOOL, not its full path $TESTFILE
##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
# ############################################################################
# # Common usage
@@ -269,43 +464,43 @@ SKIP() {
TOOLTEST h5diff_10.txt -h
# 1.1 normal mode
-TOOLTEST h5diff_11.txt $FILE1 $FILE2
+TOOLTEST h5diff_11.txt h5diff_basic1.h5 h5diff_basic2.h5
# 1.2 normal mode with objects
-TOOLTEST h5diff_12.txt $FILE1 $FILE2 g1/dset1 g1/dset2
+TOOLTEST h5diff_12.txt h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2
# 1.3 report mode
-TOOLTEST h5diff_13.txt -r $FILE1 $FILE2
+TOOLTEST h5diff_13.txt -r h5diff_basic1.h5 h5diff_basic2.h5
# 1.4 report mode with objects
-TOOLTEST h5diff_14.txt -r $FILE1 $FILE2 g1/dset1 g1/dset2
+TOOLTEST h5diff_14.txt -r h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2
# 1.5 with -d
-TOOLTEST h5diff_15.txt --report --delta=5 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_15.txt --report --delta=5 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 1.6.1 with -p (int)
-TOOLTEST h5diff_16_1.txt -v -p 0.02 $FILE1 $FILE1 g1/dset5 g1/dset6
+TOOLTEST h5diff_16_1.txt -v -p 0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset5 g1/dset6
# 1.6.2 with -p (unsigned long_long)
-TOOLTEST h5diff_16_2.txt --verbose --relative=0.02 $FILE1 $FILE1 g1/dset7 g1/dset8
+TOOLTEST h5diff_16_2.txt --verbose --relative=0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset7 g1/dset8
# 1.6.3 with -p (double)
-TOOLTEST h5diff_16_3.txt -v -p 0.02 $FILE1 $FILE1 g1/dset9 g1/dset10
+TOOLTEST h5diff_16_3.txt -v -p 0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset9 g1/dset10
# 1.7 verbose mode
-TOOLTEST h5diff_17.txt -v $FILE1 $FILE2
+TOOLTEST h5diff_17.txt -v h5diff_basic1.h5 h5diff_basic2.h5
# 1.7 test 32-bit INFINITY
-TOOLTEST h5diff_171.txt -v $FILE1 $FILE1 /g1/fp19 /g1/fp19_COPY
+TOOLTEST h5diff_171.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp19 /g1/fp19_COPY
# 1.7 test 64-bit INFINITY
-TOOLTEST h5diff_172.txt -v $FILE1 $FILE1 /g1/fp20 /g1/fp20_COPY
+TOOLTEST h5diff_172.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp20 /g1/fp20_COPY
# 1.8 quiet mode
-TOOLTEST h5diff_18.txt -q $FILE1 $FILE2
+TOOLTEST h5diff_18.txt -q h5diff_basic1.h5 h5diff_basic2.h5
# 1.8 -v and -q
-TOOLTEST h5diff_18_1.txt -v -q $FILE1 $FILE2
+TOOLTEST h5diff_18_1.txt -v -q h5diff_basic1.h5 h5diff_basic2.h5
# ##############################################################################
@@ -313,35 +508,35 @@ TOOLTEST h5diff_18_1.txt -v -q $FILE1 $FILE2
# ##############################################################################
# 2.0
-TOOLTEST h5diff_20.txt -v $FILE3 $FILE3 dset g1
+TOOLTEST h5diff_20.txt -v h5diff_types.h5 h5diff_types.h5 dset g1
# 2.1
-TOOLTEST h5diff_21.txt -v $FILE3 $FILE3 dset l1
+TOOLTEST h5diff_21.txt -v h5diff_types.h5 h5diff_types.h5 dset l1
# 2.2
-TOOLTEST h5diff_22.txt -v $FILE3 $FILE3 dset t1
+TOOLTEST h5diff_22.txt -v h5diff_types.h5 h5diff_types.h5 dset t1
# ##############################################################################
# # compare groups, types, links (no differences and differences)
# ##############################################################################
# 2.3
-TOOLTEST h5diff_23.txt -v $FILE3 $FILE3 g1 g1
+TOOLTEST h5diff_23.txt -v h5diff_types.h5 h5diff_types.h5 g1 g1
# 2.4
-TOOLTEST h5diff_24.txt -v $FILE3 $FILE3 t1 t1
+TOOLTEST h5diff_24.txt -v h5diff_types.h5 h5diff_types.h5 t1 t1
# 2.5
-TOOLTEST h5diff_25.txt -v $FILE3 $FILE3 l1 l1
+TOOLTEST h5diff_25.txt -v h5diff_types.h5 h5diff_types.h5 l1 l1
# 2.6
-TOOLTEST h5diff_26.txt -v $FILE3 $FILE3 g1 g2
+TOOLTEST h5diff_26.txt -v h5diff_types.h5 h5diff_types.h5 g1 g2
# 2.7
-TOOLTEST h5diff_27.txt -v $FILE3 $FILE3 t1 t2
+TOOLTEST h5diff_27.txt -v h5diff_types.h5 h5diff_types.h5 t1 t2
# 2.8
-TOOLTEST h5diff_28.txt -v $FILE3 $FILE3 l1 l2
+TOOLTEST h5diff_28.txt -v h5diff_types.h5 h5diff_types.h5 l1 l2
# ##############################################################################
@@ -349,7 +544,8 @@ TOOLTEST h5diff_28.txt -v $FILE3 $FILE3 l1 l2
# ##############################################################################
# 3.0
-TOOLTEST h5diff_30.txt -v $ENUM_INVALID_VALUES $ENUM_INVALID_VALUES dset1 dset2
+# test enum types which may have invalid values
+TOOLTEST h5diff_30.txt -v h5diff_enum_invalid_values.h5 h5diff_enum_invalid_values.h5 dset1 dset2
@@ -359,31 +555,31 @@ TOOLTEST h5diff_30.txt -v $ENUM_INVALID_VALUES $ENUM_INVALID_VALUES dset1 dset2
# ##############################################################################
# 5.0
-TOOLTEST h5diff_50.txt -v $FILE4 $FILE4 dset0a dset0b
+TOOLTEST h5diff_50.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset0a dset0b
# 5.1
-TOOLTEST h5diff_51.txt -v $FILE4 $FILE4 dset1a dset1b
+TOOLTEST h5diff_51.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset1a dset1b
# 5.2
-TOOLTEST h5diff_52.txt -v $FILE4 $FILE4 dset2a dset2b
+TOOLTEST h5diff_52.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset2a dset2b
# 5.3
-TOOLTEST h5diff_53.txt -v $FILE4 $FILE4 dset3a dset4b
+TOOLTEST h5diff_53.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset3a dset4b
# 5.4
-TOOLTEST h5diff_54.txt -v $FILE4 $FILE4 dset4a dset4b
+TOOLTEST h5diff_54.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset4a dset4b
# 5.5
-TOOLTEST h5diff_55.txt -v $FILE4 $FILE4 dset5a dset5b
+TOOLTEST h5diff_55.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset5a dset5b
# 5.6
-TOOLTEST h5diff_56.txt -v $FILE4 $FILE4 dset6a dset6b
+TOOLTEST h5diff_56.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset6a dset6b
# 5.7
-TOOLTEST h5diff_57.txt -v $FILE4 $FILE4 dset7a dset7b
+TOOLTEST h5diff_57.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset7a dset7b
# 5.8 (region reference)
-TOOLTEST h5diff_58.txt -v $FILE7 $FILE8 refreg
+TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg
# ##############################################################################
# # Error messages
@@ -391,10 +587,10 @@ TOOLTEST h5diff_58.txt -v $FILE7 $FILE8 refreg
# 6.0: Check if the command line number of arguments is less than 3
-TOOLTEST h5diff_600.txt $FILE1
+TOOLTEST h5diff_600.txt h5diff_basic1.h5
# 6.1: Check if non-exist object name is specified
-TOOLTEST h5diff_601.txt $FILE1 $FILE1 nono_obj
+TOOLTEST h5diff_601.txt h5diff_basic1.h5 h5diff_basic1.h5 nono_obj
# ##############################################################################
@@ -403,28 +599,28 @@ TOOLTEST h5diff_601.txt $FILE1 $FILE1 nono_obj
# 6.3: negative value
-TOOLTEST h5diff_603.txt -d -4 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_603.txt -d -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.4: zero
-TOOLTEST h5diff_604.txt -d 0 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_604.txt -d 0 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.5: non number
-TOOLTEST h5diff_605.txt -d u $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_605.txt -d u h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.6: hexadecimal
-TOOLTEST h5diff_606.txt -d 0x1 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_606.txt -d 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.7: string
-TOOLTEST h5diff_607.txt -d "1" $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_607.txt -d "1" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.8: use system epsilon
-TOOLTEST h5diff_608.txt --use-system-epsilon $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_608.txt --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.9: number larger than biggest difference
-TOOLTEST h5diff_609.txt -d 200 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_609.txt -d 200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.10: number smaller than smallest difference
-TOOLTEST h5diff_610.txt -d 1 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_610.txt -d 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# ##############################################################################
@@ -433,28 +629,28 @@ TOOLTEST h5diff_610.txt -d 1 $FILE1 $FILE2 g1/dset3 g1/dset4
# 6.12: negative value
-TOOLTEST h5diff_612.txt -p -4 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_612.txt -p -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.13: zero
-TOOLTEST h5diff_613.txt -p 0 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_613.txt -p 0 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.14: non number
-TOOLTEST h5diff_614.txt -p u $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_614.txt -p u h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.15: hexadecimal
-TOOLTEST h5diff_615.txt -p 0x1 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_615.txt -p 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.16: string
-TOOLTEST h5diff_616.txt -p "0.21" $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_616.txt -p "0.21" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.17: repeated option
-TOOLTEST h5diff_617.txt -p 0.21 -p 0.22 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_617.txt -p 0.21 -p 0.22 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.18: number larger than biggest difference
-TOOLTEST h5diff_618.txt -p 2 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_618.txt -p 2 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.19: number smaller than smallest difference
-TOOLTEST h5diff_619.txt -p 0.005 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_619.txt -p 0.005 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
@@ -463,28 +659,28 @@ TOOLTEST h5diff_619.txt -p 0.005 $FILE1 $FILE2 g1/dset3 g1/dset4
# ##############################################################################
# 6.21: negative value
-TOOLTEST h5diff_621.txt -n -4 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_621.txt -n -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.22: zero
-TOOLTEST h5diff_622.txt -n 0 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_622.txt -n 0 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.23: non number
-TOOLTEST h5diff_623.txt -n u $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_623.txt -n u h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.24: hexadecimal
-TOOLTEST h5diff_624.txt -n 0x1 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_624.txt -n 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.25: string
-TOOLTEST h5diff_625.txt -n "2" $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_625.txt -n "2" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.26: repeated option
-TOOLTEST h5diff_626.txt -n 2 -n 3 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_626.txt -n 2 -n 3 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.27: number larger than biggest difference
-TOOLTEST h5diff_627.txt --count=200 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_627.txt --count=200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# 6.28: number smaller than smallest difference
-TOOLTEST h5diff_628.txt -n 1 $FILE1 $FILE2 g1/dset3 g1/dset4
+TOOLTEST h5diff_628.txt -n 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4
# Disabling this test as it hangs - LRK 20090618
# 6.29 non valid files
@@ -494,258 +690,258 @@ TOOLTEST h5diff_628.txt -n 1 $FILE1 $FILE2 g1/dset3 g1/dset4
# ##############################################################################
# 7. attributes
# ##############################################################################
-TOOLTEST h5diff_70.txt -v $FILE5 $FILE6
+TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5
# ##################################################
# attrs with verbose option level
# ##################################################
-TOOLTEST h5diff_700.txt -v1 $FILE5 $FILE6
-TOOLTEST h5diff_701.txt -v2 $FILE5 $FILE6
-TOOLTEST h5diff_702.txt --verbose=1 $FILE5 $FILE6
-TOOLTEST h5diff_703.txt --verbose=2 $FILE5 $FILE6
+TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5
+TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5
+TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5
+TOOLTEST h5diff_703.txt --verbose=2 h5diff_attr1.h5 h5diff_attr2.h5
# same attr number , all same attr name
-TOOLTEST h5diff_704.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g
+TOOLTEST h5diff_704.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g
# same attr number , some same attr name
-TOOLTEST h5diff_705.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /dset
+TOOLTEST h5diff_705.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /dset
# same attr number , all different attr name
-TOOLTEST h5diff_706.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /ntype
+TOOLTEST h5diff_706.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /ntype
# different attr number , same attr name (intersected)
-TOOLTEST h5diff_707.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g2
+TOOLTEST h5diff_707.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g2
# different attr number , all different attr name
-TOOLTEST h5diff_708.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g3
+TOOLTEST h5diff_708.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g3
# when no attributes exist in both objects
-TOOLTEST h5diff_709.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g4
+TOOLTEST h5diff_709.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g4
# file vs file
-TOOLTEST h5diff_710.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2
+TOOLTEST h5diff_710.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5
# ##############################################################################
# 8. all dataset datatypes
# ##############################################################################
-TOOLTEST h5diff_80.txt -v $FILE7 $FILE8
+TOOLTEST h5diff_80.txt -v h5diff_dset1.h5 h5diff_dset2.h5
# 9. compare a file with itself
-TOOLTEST h5diff_90.txt -v $FILE2 $FILE2
+TOOLTEST h5diff_90.txt -v h5diff_basic2.h5 h5diff_basic2.h5
# 10. read by hyperslab, print indexes
if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then
# skip this test which sometimes hangs in some THG machines
- SKIP -v $FILE9 $FILE10
+ SKIP -v h5diff_hyper1.h5 h5diff_hyper2.h5
else
- TOOLTEST h5diff_100.txt -v $FILE9 $FILE10
+ TOOLTEST h5diff_100.txt -v h5diff_hyper1.h5 h5diff_hyper2.h5
fi
# 11. floating point comparison
# double value
-TOOLTEST h5diff_101.txt -v $FILE1 $FILE1 g1/d1 g1/d2
+TOOLTEST h5diff_101.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2
# float value
-TOOLTEST h5diff_102.txt -v $FILE1 $FILE1 g1/fp1 g1/fp2
+TOOLTEST h5diff_102.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2
# with --use-system-epsilon for double value
-TOOLTEST h5diff_103.txt -v --use-system-epsilon $FILE1 $FILE1 g1/d1 g1/d2
+TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2
# with --use-system-epsilon for float value
-TOOLTEST h5diff_104.txt -v --use-system-epsilon $FILE1 $FILE1 g1/fp1 g1/fp2
+TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2
# not comparable -c flag
-TOOLTEST h5diff_200.txt $FILE2 $FILE2 g2/dset1 g2/dset2
+TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2
-TOOLTEST h5diff_201.txt -c $FILE2 $FILE2 g2/dset1 g2/dset2
+TOOLTEST h5diff_201.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2
-TOOLTEST h5diff_202.txt -c $FILE2 $FILE2 g2/dset2 g2/dset3
+TOOLTEST h5diff_202.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset2 g2/dset3
-TOOLTEST h5diff_203.txt -c $FILE2 $FILE2 g2/dset3 g2/dset4
+TOOLTEST h5diff_203.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset3 g2/dset4
-TOOLTEST h5diff_204.txt -c $FILE2 $FILE2 g2/dset4 g2/dset5
+TOOLTEST h5diff_204.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset4 g2/dset5
-TOOLTEST h5diff_205.txt -c $FILE2 $FILE2 g2/dset5 g2/dset6
+TOOLTEST h5diff_205.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset5 g2/dset6
# not comparable in compound
-TOOLTEST h5diff_206.txt -c $FILE2 $FILE2 g2/dset7 g2/dset8
+TOOLTEST h5diff_206.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset7 g2/dset8
-TOOLTEST h5diff_207.txt -c $FILE2 $FILE2 g2/dset8 g2/dset9
+TOOLTEST h5diff_207.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset8 g2/dset9
# not comparable in dataspace of zero dimension size
-TOOLTEST h5diff_208.txt -c $FILE19 $FILE20
+TOOLTEST h5diff_208.txt -c h5diff_dset_zero_dim_size1.h5 h5diff_dset_zero_dim_size2.h5
# ##############################################################################
# # Links compare without --follow-symlinks nor --no-dangling-links
# ##############################################################################
# test for bug1749
-TOOLTEST h5diff_300.txt -v $FILE12 $FILE12 /link_g1 /link_g2
+TOOLTEST h5diff_300.txt -v h5diff_links.h5 h5diff_links.h5 /link_g1 /link_g2
# ##############################################################################
# # Links compare with --follow-symlinks Only
# ##############################################################################
# soft links file to file
-TOOLTEST h5diff_400.txt --follow-symlinks -v $FILE13 $FILE13
+TOOLTEST h5diff_400.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5
# softlink vs dset"
-TOOLTEST h5diff_401.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset1_1 /target_dset2
+TOOLTEST h5diff_401.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset1_1 /target_dset2
# dset vs softlink"
-TOOLTEST h5diff_402.txt --follow-symlinks -v $FILE13 $FILE13 /target_dset2 /softlink_dset1_1
+TOOLTEST h5diff_402.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /target_dset2 /softlink_dset1_1
# softlink vs softlink"
-TOOLTEST h5diff_403.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset1_1 /softlink_dset2
+TOOLTEST h5diff_403.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset1_1 /softlink_dset2
# extlink vs extlink (FILE)"
-TOOLTEST h5diff_404.txt --follow-symlinks -v $FILE15 $FILE15
+TOOLTEST h5diff_404.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5
# extlink vs dset"
-TOOLTEST h5diff_405.txt --follow-symlinks -v $FILE15 $FILE16 /ext_link_dset1 /target_group2/x_dset
+TOOLTEST h5diff_405.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_trg.h5 /ext_link_dset1 /target_group2/x_dset
# dset vs extlink"
-TOOLTEST h5diff_406.txt --follow-symlinks -v $FILE16 $FILE15 /target_group2/x_dset /ext_link_dset1
+TOOLTEST h5diff_406.txt --follow-symlinks -v h5diff_extlink_trg.h5 h5diff_extlink_src.h5 /target_group2/x_dset /ext_link_dset1
# extlink vs extlink"
-TOOLTEST h5diff_407.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset1 /ext_link_dset2
+TOOLTEST h5diff_407.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_dset2
# softlink vs extlink"
-TOOLTEST h5diff_408.txt --follow-symlinks -v $FILE13 $FILE15 /softlink_dset1_1 /ext_link_dset2
+TOOLTEST h5diff_408.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_extlink_src.h5 /softlink_dset1_1 /ext_link_dset2
# extlink vs softlink "
-TOOLTEST h5diff_409.txt --follow-symlinks -v $FILE15 $FILE13 /ext_link_dset2 /softlink_dset1_1
+TOOLTEST h5diff_409.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_softlinks.h5 /ext_link_dset2 /softlink_dset1_1
# linked_softlink vs linked_softlink (FILE)"
-TOOLTEST h5diff_410.txt --follow-symlinks -v $FILE14 $FILE14
+TOOLTEST h5diff_410.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5
# dset2 vs linked_softlink_dset1"
-TOOLTEST h5diff_411.txt --follow-symlinks -v $FILE14 $FILE14 /target_dset2 /softlink1_to_slink2
+TOOLTEST h5diff_411.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /target_dset2 /softlink1_to_slink2
# linked_softlink_dset1 vs dset2"
-TOOLTEST h5diff_412.txt --follow-symlinks -v $FILE14 $FILE14 /softlink1_to_slink2 /target_dset2
+TOOLTEST h5diff_412.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink1_to_slink2 /target_dset2
# linked_softlink_to_dset1 vs linked_softlink_to_dset2"
-TOOLTEST h5diff_413.txt --follow-symlinks -v $FILE14 $FILE14 /softlink1_to_slink2 /softlink2_to_slink2
+TOOLTEST h5diff_413.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink1_to_slink2 /softlink2_to_slink2
# group vs linked_softlink_group1"
-TOOLTEST h5diff_414.txt --follow-symlinks -v $FILE14 $FILE14 /target_group /softlink3_to_slink2
+TOOLTEST h5diff_414.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /target_group /softlink3_to_slink2
# linked_softlink_group1 vs group"
-TOOLTEST h5diff_415.txt --follow-symlinks -v $FILE14 $FILE14 /softlink3_to_slink2 /target_group
+TOOLTEST h5diff_415.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink3_to_slink2 /target_group
# linked_softlink_to_group1 vs linked_softlink_to_group2"
-TOOLTEST h5diff_416.txt --follow-symlinks -v $FILE14 $FILE14 /softlink3_to_slink2 /softlink4_to_slink2
+TOOLTEST h5diff_416.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink3_to_slink2 /softlink4_to_slink2
# non-exist-softlink vs softlink"
-TOOLTEST h5diff_417.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_noexist /softlink_dset2
+TOOLTEST h5diff_417.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_dset2
# softlink vs non-exist-softlink"
-TOOLTEST h5diff_418.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset2 /softlink_noexist
+TOOLTEST h5diff_418.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist
# non-exist-extlink_file vs extlink"
-TOOLTEST h5diff_419.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_noexist2 /ext_link_dset2
+TOOLTEST h5diff_419.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist2 /ext_link_dset2
# exlink vs non-exist-extlink_file"
-TOOLTEST h5diff_420.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist2
+TOOLTEST h5diff_420.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset2 /ext_link_noexist2
# extlink vs non-exist-extlink_obj"
-TOOLTEST h5diff_421.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist1
+TOOLTEST h5diff_421.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset2 /ext_link_noexist1
# non-exist-extlink_obj vs extlink"
-TOOLTEST h5diff_422.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_noexist1 /ext_link_dset2
+TOOLTEST h5diff_422.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist1 /ext_link_dset2
# extlink_to_softlink_to_dset1 vs dset2"
-TOOLTEST h5diff_423.txt --follow-symlinks -v $FILE17 $FILE18 /ext_link_to_slink1 /dset2
+TOOLTEST h5diff_423.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_trg.h5 /ext_link_to_slink1 /dset2
# dset2 vs extlink_to_softlink_to_dset1"
-TOOLTEST h5diff_424.txt --follow-symlinks -v $FILE18 $FILE17 /dset2 /ext_link_to_slink1
+TOOLTEST h5diff_424.txt --follow-symlinks -v h5diff_ext2softlink_trg.h5 h5diff_ext2softlink_src.h5 /dset2 /ext_link_to_slink1
# extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2"
-TOOLTEST h5diff_425.txt --follow-symlinks -v $FILE17 $FILE17 /ext_link_to_slink1 /ext_link_to_slink2
+TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_src.h5 /ext_link_to_slink1 /ext_link_to_slink2
# ##############################################################################
# # Dangling links compare (--follow-symlinks and --no-dangling-links)
# ##############################################################################
# dangling links --follow-symlinks (FILE to FILE)
-TOOLTEST h5diff_450.txt --follow-symlinks -v $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2
+TOOLTEST h5diff_450.txt --follow-symlinks -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5
# dangling links --follow-symlinks and --no-dangling-links (FILE to FILE)
-TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2
+TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links h5diff_danglelinks1.h5 h5diff_danglelinks2.h5
# try --no-dangling-links without --follow-symlinks options
-TOOLTEST h5diff_452.txt --no-dangling-links $FILE13 $FILE13
+TOOLTEST h5diff_452.txt --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5
# dangling link found for soft links (FILE to FILE)
-TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13
+TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5
# dangling link found for soft links (obj to obj)
-TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 /softlink_dset2 /softlink_noexist
+TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist
# dangling link found for soft links (obj to obj) Both dangle links
-TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 /softlink_noexist /softlink_noexist
+TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_noexist
# dangling link found for ext links (FILE to FILE)
-TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15
+TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5
# dangling link found for ext links (obj to obj). target file exist
-TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist1
+TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist1
# dangling link found for ext links (obj to obj). target file NOT exist
-TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist2
+TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist2
# dangling link found for ext links (obj to obj). Both dangle links
-TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_noexist1 /ext_link_noexist2
+TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist1 /ext_link_noexist2
# ##############################################################################
# # test for group diff recursivly
# ##############################################################################
# root
-TOOLTEST h5diff_500.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 / /
-TOOLTEST h5diff_501.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 / /
+TOOLTEST h5diff_500.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / /
+TOOLTEST h5diff_501.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / /
# root vs group
-TOOLTEST h5diff_502.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 / /grp1/grp2/grp3
+TOOLTEST h5diff_502.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / /grp1/grp2/grp3
# group vs group (same name and structure)
-TOOLTEST h5diff_503.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /grp1
+TOOLTEST h5diff_503.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /grp1
# group vs group (different name and structure)
-TOOLTEST h5diff_504.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1/grp2 /grp1/grp2/grp3
+TOOLTEST h5diff_504.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1/grp2 /grp1/grp2/grp3
# groups vs soft-link
-TOOLTEST h5diff_505.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /slink_grp1
-TOOLTEST h5diff_506.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1/grp2 /slink_grp2
+TOOLTEST h5diff_505.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /slink_grp1
+TOOLTEST h5diff_506.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1/grp2 /slink_grp2
# groups vs ext-link
-TOOLTEST h5diff_507.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /elink_grp1
-TOOLTEST h5diff_508.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /elink_grp1
+TOOLTEST h5diff_507.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /elink_grp1
+TOOLTEST h5diff_508.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /elink_grp1
# soft-link vs ext-link
-TOOLTEST h5diff_509.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp1 /elink_grp1
-TOOLTEST h5diff_510.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp1 /elink_grp1
+TOOLTEST h5diff_509.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp1 /elink_grp1
+TOOLTEST h5diff_510.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp1 /elink_grp1
# circled ext links
-TOOLTEST h5diff_511.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp10 /grp11
-TOOLTEST h5diff_512.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp10 /grp11
+TOOLTEST h5diff_511.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp10 /grp11
+TOOLTEST h5diff_512.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp10 /grp11
# circled soft2ext-link vs soft2ext-link
-TOOLTEST h5diff_513.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp10 /slink_grp11
-TOOLTEST h5diff_514.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp10 /slink_grp11
+TOOLTEST h5diff_513.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp10 /slink_grp11
+TOOLTEST h5diff_514.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp10 /slink_grp11
###############################################################################
# Test for group recursive diff via multi-linked external links
-# With follow-symlinks, file $GRP_RECURSE1_EXT and $GRP_RECURSE2_EXT1 should
+# With follow-symlinks, file h5diff_grp_recurse_ext1.h5 and h5diff_grp_recurse_ext2-1.h5 should
# be same with the external links.
###############################################################################
# file vs file
-TOOLTEST h5diff_515.txt -v $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1
-TOOLTEST h5diff_516.txt -v --follow-symlinks $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1
+TOOLTEST h5diff_515.txt -v h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5
+TOOLTEST h5diff_516.txt -v --follow-symlinks h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5
# group vs group
-TOOLTEST h5diff_517.txt -v $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1 /g1
-TOOLTEST h5diff_518.txt -v --follow-symlinks $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1 /g1
+TOOLTEST h5diff_517.txt -v h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5 /g1
+TOOLTEST h5diff_518.txt -v --follow-symlinks h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5 /g1
# ##############################################################################
# # Exclude objects (--exclude-path)
@@ -754,25 +950,25 @@ TOOLTEST h5diff_518.txt -v --follow-symlinks $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT
# Same structure, same names and different value.
#
# Exclude the object with different value. Expect return - same
-TOOLTEST h5diff_480.txt -v --exclude-path /group1/dset3 $EXCLUDE_FILE1_1 $EXCLUDE_FILE1_2
+TOOLTEST h5diff_480.txt -v --exclude-path /group1/dset3 h5diff_exclude1-1.h5 h5diff_exclude1-2.h5
# Verify different by not excluding. Expect return - diff
-TOOLTEST h5diff_481.txt -v $EXCLUDE_FILE1_1 $EXCLUDE_FILE1_2
+TOOLTEST h5diff_481.txt -v h5diff_exclude1-1.h5 h5diff_exclude1-2.h5
#
# Different structure, different names.
#
# Exclude all the different objects. Expect return - same
-TOOLTEST h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" $EXCLUDE_FILE2_1 $EXCLUDE_FILE2_2
+TOOLTEST h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" h5diff_exclude2-1.h5 h5diff_exclude2-2.h5
# Exclude only some different objects. Expect return - diff
-TOOLTEST h5diff_483.txt -v --exclude-path "/group1" $EXCLUDE_FILE2_1 $EXCLUDE_FILE2_2
+TOOLTEST h5diff_483.txt -v --exclude-path "/group1" h5diff_exclude2-1.h5 h5diff_exclude2-2.h5
# Exclude from group compare
-TOOLTEST h5diff_484.txt -v --exclude-path "/dset3" $EXCLUDE_FILE1_1 $EXCLUDE_FILE1_2 /group1
+TOOLTEST h5diff_484.txt -v --exclude-path "/dset3" h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 /group1
# ##############################################################################
# # diff various multiple vlen and fixed strings in a compound type dataset
# ##############################################################################
-TOOLTEST h5diff_530.txt -v $COMP_VL_STRS_FILE $COMP_VL_STRS_FILE /group /group_copy
+TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy
# ##############################################################################
# # END
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index c33bd37..3aac02c 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -29,7 +29,6 @@ EXIT_FAILURE=1
DUMPER=h5dump # The tool name
DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
-TESTDIR=`pwd`/../testfiles
H5DIFF=../h5diff/h5diff # The h5diff tool name
H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
@@ -40,6 +39,7 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
CMP='cmp -s'
DIFF='diff -c'
+CP='cp'
nerrors=0
verbose=yes
@@ -48,9 +48,412 @@ verbose=yes
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"
+
+TESTDIR=./testfiles
test -d $TESTDIR || mkdir $TESTDIR
+######################################################################
+# 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_HDF5_TEST_FILES="
+$SRC_H5DUMP_TESTFILES/file_space.h5
+$SRC_H5DUMP_TESTFILES/filter_fail.h5
+$SRC_H5DUMP_TESTFILES/packedbits.h5
+$SRC_H5DUMP_TESTFILES/taindices.h5
+$SRC_H5DUMP_TESTFILES/tall.h5
+$SRC_H5DUMP_TESTFILES/tarray1.h5
+$SRC_H5DUMP_TESTFILES/tarray1_big.h5
+$SRC_H5DUMP_TESTFILES/tarray2.h5
+$SRC_H5DUMP_TESTFILES/tarray3.h5
+$SRC_H5DUMP_TESTFILES/tarray4.h5
+$SRC_H5DUMP_TESTFILES/tarray5.h5
+$SRC_H5DUMP_TESTFILES/tarray6.h5
+$SRC_H5DUMP_TESTFILES/tarray7.h5
+$SRC_H5DUMP_TESTFILES/tarray8.h5
+$SRC_H5DUMP_TESTFILES/tattr.h5
+$SRC_H5DUMP_TESTFILES/tattr2.h5
+$SRC_H5DUMP_TESTFILES/tattrreg.h5
+$SRC_H5DUMP_TESTFILES/tbigdims.h5
+$SRC_H5DUMP_TESTFILES/tbinary.h5
+$SRC_H5DUMP_TESTFILES/tchar.h5
+$SRC_H5DUMP_TESTFILES/tcompound.h5
+$SRC_H5DUMP_TESTFILES/tcompound_complex.h5
+$SRC_H5DUMP_TESTFILES/tdatareg.h5
+$SRC_H5DUMP_TESTFILES/tdset.h5
+$SRC_H5DUMP_TESTFILES/tempty.h5
+$SRC_H5DUMP_TESTFILES/tsoftlinks.h5
+$SRC_H5DUMP_TESTFILES/textlinkfar.h5
+$SRC_H5DUMP_TESTFILES/textlinksrc.h5
+$SRC_H5DUMP_TESTFILES/textlinktar.h5
+$SRC_H5DUMP_TESTFILES/textlink.h5
+$SRC_H5DUMP_TESTFILES/tfamily00000.h5
+$SRC_H5DUMP_TESTFILES/tfamily00001.h5
+$SRC_H5DUMP_TESTFILES/tfamily00002.h5
+$SRC_H5DUMP_TESTFILES/tfamily00003.h5
+$SRC_H5DUMP_TESTFILES/tfamily00004.h5
+$SRC_H5DUMP_TESTFILES/tfamily00005.h5
+$SRC_H5DUMP_TESTFILES/tfamily00006.h5
+$SRC_H5DUMP_TESTFILES/tfamily00007.h5
+$SRC_H5DUMP_TESTFILES/tfamily00008.h5
+$SRC_H5DUMP_TESTFILES/tfamily00009.h5
+$SRC_H5DUMP_TESTFILES/tfamily00010.h5
+$SRC_H5DUMP_TESTFILES/tfcontents1.h5
+$SRC_H5DUMP_TESTFILES/tfcontents2.h5
+$SRC_H5DUMP_TESTFILES/tfilters.h5
+$SRC_H5DUMP_TESTFILES/tfpformat.h5
+$SRC_H5DUMP_TESTFILES/tfvalues.h5
+$SRC_H5DUMP_TESTFILES/tgroup.h5
+$SRC_H5DUMP_TESTFILES/tgrp_comments.h5
+$SRC_H5DUMP_TESTFILES/thlink.h5
+$SRC_H5DUMP_TESTFILES/thyperslab.h5
+$SRC_H5DUMP_TESTFILES/tlarge_objname.h5
+#$SRC_H5DUMP_TESTFILES/tldouble.h5
+$SRC_H5DUMP_TESTFILES/tlonglinks.h5
+$SRC_H5DUMP_TESTFILES/tloop.h5
+$SRC_H5DUMP_TESTFILES/tmulti-b.h5
+$SRC_H5DUMP_TESTFILES/tmulti-g.h5
+$SRC_H5DUMP_TESTFILES/tmulti-l.h5
+$SRC_H5DUMP_TESTFILES/tmulti-o.h5
+$SRC_H5DUMP_TESTFILES/tmulti-r.h5
+$SRC_H5DUMP_TESTFILES/tmulti-s.h5
+$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5
+$SRC_H5DUMP_TESTFILES/tnestedcomp.h5
+$SRC_H5DUMP_TESTFILES/tnullspace.h5
+$SRC_H5DUMP_TESTFILES/zerodim.h5
+$SRC_H5DUMP_TESTFILES/torderattr.h5
+$SRC_H5DUMP_TESTFILES/tordergr.h5
+$SRC_H5DUMP_TESTFILES/tsaf.h5
+$SRC_H5DUMP_TESTFILES/tslink.h5
+$SRC_H5DUMP_TESTFILES/tsplit_file-m.h5
+$SRC_H5DUMP_TESTFILES/tsplit_file-r.h5
+$SRC_H5DUMP_TESTFILES/tstr.h5
+$SRC_H5DUMP_TESTFILES/tstr2.h5
+$SRC_H5DUMP_TESTFILES/tstr3.h5
+$SRC_H5DUMP_TESTFILES/tudlink.h5
+$SRC_H5DUMP_TESTFILES/tvldtypes1.h5
+$SRC_H5DUMP_TESTFILES/tvldtypes2.h5
+$SRC_H5DUMP_TESTFILES/tvldtypes3.h5
+$SRC_H5DUMP_TESTFILES/tvldtypes4.h5
+$SRC_H5DUMP_TESTFILES/tvldtypes5.h5
+$SRC_H5DUMP_TESTFILES/tvlstr.h5
+$SRC_H5DUMP_TESTFILES/tvms.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5DUMP_TESTFILES/file_space.ddl
+$SRC_H5DUMP_TESTFILES/filter_fail.ddl
+$SRC_H5DUMP_TESTFILES/packedbits.ddl
+$SRC_H5DUMP_TESTFILES/tall-1.ddl
+$SRC_H5DUMP_TESTFILES/tall-2.ddl
+$SRC_H5DUMP_TESTFILES/tall-2A.ddl
+$SRC_H5DUMP_TESTFILES/tall-2B.ddl
+$SRC_H5DUMP_TESTFILES/tall-3.ddl
+$SRC_H5DUMP_TESTFILES/tall-4s.ddl
+$SRC_H5DUMP_TESTFILES/tall-5s.ddl
+$SRC_H5DUMP_TESTFILES/tall-6.ddl
+$SRC_H5DUMP_TESTFILES/tallfilters.ddl
+$SRC_H5DUMP_TESTFILES/tarray1.ddl
+$SRC_H5DUMP_TESTFILES/tarray1_big.ddl
+$SRC_H5DUMP_TESTFILES/tarray2.ddl
+$SRC_H5DUMP_TESTFILES/tarray3.ddl
+$SRC_H5DUMP_TESTFILES/tarray4.ddl
+$SRC_H5DUMP_TESTFILES/tarray5.ddl
+$SRC_H5DUMP_TESTFILES/tarray6.ddl
+$SRC_H5DUMP_TESTFILES/tarray7.ddl
+$SRC_H5DUMP_TESTFILES/tarray8.ddl
+$SRC_H5DUMP_TESTFILES/tattr-1.ddl
+$SRC_H5DUMP_TESTFILES/tattr-2.ddl
+$SRC_H5DUMP_TESTFILES/tattr-3.ddl
+$SRC_H5DUMP_TESTFILES/tattrreg.ddl
+$SRC_H5DUMP_TESTFILES/tattrregR.ddl
+$SRC_H5DUMP_TESTFILES/tbin1.ddl
+$SRC_H5DUMP_TESTFILES/tbin1.ddl
+$SRC_H5DUMP_TESTFILES/tbin2.ddl
+$SRC_H5DUMP_TESTFILES/tbin3.ddl
+$SRC_H5DUMP_TESTFILES/tbin4.ddl
+$SRC_H5DUMP_TESTFILES/tbinregR.ddl
+$SRC_H5DUMP_TESTFILES/tbigdims.ddl
+$SRC_H5DUMP_TESTFILES/tboot1.ddl
+$SRC_H5DUMP_TESTFILES/tboot2.ddl
+$SRC_H5DUMP_TESTFILES/tchar1.ddl
+$SRC_H5DUMP_TESTFILES/tchunked.ddl
+$SRC_H5DUMP_TESTFILES/tcomp-1.ddl
+$SRC_H5DUMP_TESTFILES/tcomp-2.ddl
+$SRC_H5DUMP_TESTFILES/tcomp-3.ddl
+$SRC_H5DUMP_TESTFILES/tcomp-4.ddl
+$SRC_H5DUMP_TESTFILES/tcompact.ddl
+$SRC_H5DUMP_TESTFILES/tcontents.ddl
+$SRC_H5DUMP_TESTFILES/tcontiguos.ddl
+$SRC_H5DUMP_TESTFILES/tdatareg.ddl
+$SRC_H5DUMP_TESTFILES/tdataregR.ddl
+$SRC_H5DUMP_TESTFILES/tdeflate.ddl
+$SRC_H5DUMP_TESTFILES/tdset-1.ddl
+$SRC_H5DUMP_TESTFILES/tdset-2.ddl
+$SRC_H5DUMP_TESTFILES/tdset-3s.ddl
+$SRC_H5DUMP_TESTFILES/tempty.ddl
+$SRC_H5DUMP_TESTFILES/texceedsubstart.ddl
+$SRC_H5DUMP_TESTFILES/texceedsubcount.ddl
+$SRC_H5DUMP_TESTFILES/texceedsubstride.ddl
+$SRC_H5DUMP_TESTFILES/texceedsubblock.ddl
+$SRC_H5DUMP_TESTFILES/texternal.ddl
+$SRC_H5DUMP_TESTFILES/textlinksrc.ddl
+$SRC_H5DUMP_TESTFILES/textlinkfar.ddl
+$SRC_H5DUMP_TESTFILES/textlink.ddl
+$SRC_H5DUMP_TESTFILES/tfamily.ddl
+$SRC_H5DUMP_TESTFILES/tfill.ddl
+$SRC_H5DUMP_TESTFILES/tfletcher32.ddl
+$SRC_H5DUMP_TESTFILES/tfpformat.ddl
+$SRC_H5DUMP_TESTFILES/tgroup-1.ddl
+$SRC_H5DUMP_TESTFILES/tgroup-2.ddl
+$SRC_H5DUMP_TESTFILES/tgrp_comments.ddl
+$SRC_H5DUMP_TESTFILES/thlink-1.ddl
+$SRC_H5DUMP_TESTFILES/thlink-2.ddl
+$SRC_H5DUMP_TESTFILES/thlink-3.ddl
+$SRC_H5DUMP_TESTFILES/thlink-4.ddl
+$SRC_H5DUMP_TESTFILES/thlink-5.ddl
+$SRC_H5DUMP_TESTFILES/thyperslab.ddl
+$SRC_H5DUMP_TESTFILES/tindicesno.ddl
+$SRC_H5DUMP_TESTFILES/tindicessub1.ddl
+$SRC_H5DUMP_TESTFILES/tindicessub2.ddl
+$SRC_H5DUMP_TESTFILES/tindicessub3.ddl
+$SRC_H5DUMP_TESTFILES/tindicessub4.ddl
+$SRC_H5DUMP_TESTFILES/tindicesyes.ddl
+$SRC_H5DUMP_TESTFILES/tlarge_objname.ddl
+#$SRC_H5DUMP_TESTFILES/tldouble.ddl
+$SRC_H5DUMP_TESTFILES/tlonglinks.ddl
+$SRC_H5DUMP_TESTFILES/tloop-1.ddl
+$SRC_H5DUMP_TESTFILES/tmulti.ddl
+$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl
+$SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl
+$SRC_H5DUMP_TESTFILES/tnbit.ddl
+$SRC_H5DUMP_TESTFILES/tnofilename.ddl
+$SRC_H5DUMP_TESTFILES/tnullspace.ddl
+$SRC_H5DUMP_TESTFILES/zerodim.ddl
+$SRC_H5DUMP_TESTFILES/tordergr1.ddl
+$SRC_H5DUMP_TESTFILES/tordergr2.ddl
+$SRC_H5DUMP_TESTFILES/tordergr3.ddl
+$SRC_H5DUMP_TESTFILES/tordergr4.ddl
+$SRC_H5DUMP_TESTFILES/tordergr5.ddl
+$SRC_H5DUMP_TESTFILES/torderattr1.ddl
+$SRC_H5DUMP_TESTFILES/torderattr2.ddl
+$SRC_H5DUMP_TESTFILES/torderattr3.ddl
+$SRC_H5DUMP_TESTFILES/torderattr4.ddl
+$SRC_H5DUMP_TESTFILES/tperror.ddl
+$SRC_H5DUMP_TESTFILES/treference.ddl
+$SRC_H5DUMP_TESTFILES/tsaf.ddl
+$SRC_H5DUMP_TESTFILES/tscaleoffset.ddl
+$SRC_H5DUMP_TESTFILES/tshuffle.ddl
+$SRC_H5DUMP_TESTFILES/tslink-1.ddl
+$SRC_H5DUMP_TESTFILES/tslink-2.ddl
+$SRC_H5DUMP_TESTFILES/tsplit_file.ddl
+$SRC_H5DUMP_TESTFILES/tstr-1.ddl
+$SRC_H5DUMP_TESTFILES/tstr-2.ddl
+$SRC_H5DUMP_TESTFILES/tstring.ddl
+$SRC_H5DUMP_TESTFILES/tstring2.ddl
+$SRC_H5DUMP_TESTFILES/tstringe.ddl
+$SRC_H5DUMP_TESTFILES/tszip.ddl
+$SRC_H5DUMP_TESTFILES/tudlink-1.ddl
+$SRC_H5DUMP_TESTFILES/tudlink-2.ddl
+$SRC_H5DUMP_TESTFILES/tuserfilter.ddl
+$SRC_H5DUMP_TESTFILES/tvldtypes1.ddl
+$SRC_H5DUMP_TESTFILES/tvldtypes2.ddl
+$SRC_H5DUMP_TESTFILES/tvldtypes3.ddl
+$SRC_H5DUMP_TESTFILES/tvldtypes4.ddl
+$SRC_H5DUMP_TESTFILES/tvldtypes5.ddl
+$SRC_H5DUMP_TESTFILES/tvlstr.ddl
+$SRC_H5DUMP_TESTFILES/tvms.ddl
+$SRC_H5DUMP_TESTFILES/h5dump-help.txt
+$SRC_H5DUMP_TESTFILES/out3.h5import
+$SRC_H5DUMP_TESTFILES/tnofilename-with-packed-bits.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsArray.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsCompound.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsIncomplete.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsCharLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsIntLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsLongLengthExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsLengthPositive.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsMax.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsMaxExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsCharOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsIntOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsLongOffsetExceeded.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsOffsetNegative.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsOverlapped.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSigned.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsigned.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedInt.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLong.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedIntWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedIntWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole1.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole1.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole63.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole63.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSigned4.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsigned4.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedInt8.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt8.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLong16.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong16.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong32.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong32.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSigned2.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsigned2.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedInt4.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt4.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLong8.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong8.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong16.ddl
+$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong16.ddl
+$SRC_H5DUMP_TESTFILES/tbinregR.exp
+"
+
+LIST_HDF5_TEST_FILES_XML="
+$SRC_H5DUMP_TESTFILES/tbitfields.h5
+$SRC_H5DUMP_TESTFILES/tcompound2.h5
+$SRC_H5DUMP_TESTFILES/tdset2.h5
+$SRC_H5DUMP_TESTFILES/tenum.h5
+$SRC_H5DUMP_TESTFILES/textlink.h5
+$SRC_H5DUMP_TESTFILES/tloop2.h5
+$SRC_H5DUMP_TESTFILES/tmany.h5
+$SRC_H5DUMP_TESTFILES/tname-amp.h5
+$SRC_H5DUMP_TESTFILES/tname-apos.h5
+$SRC_H5DUMP_TESTFILES/tname-gt.h5
+$SRC_H5DUMP_TESTFILES/tname-lt.h5
+$SRC_H5DUMP_TESTFILES/tname-quot.h5
+$SRC_H5DUMP_TESTFILES/tname-sp.h5
+$SRC_H5DUMP_TESTFILES/tnodata.h5
+$SRC_H5DUMP_TESTFILES/tobjref.h5
+$SRC_H5DUMP_TESTFILES/topaque.h5
+$SRC_H5DUMP_TESTFILES/tref.h5
+$SRC_H5DUMP_TESTFILES/tref-escapes.h5
+$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5
+$SRC_H5DUMP_TESTFILES/tstring.h5
+$SRC_H5DUMP_TESTFILES/tstring-at.h5
+"
+
+LIST_OTHER_TEST_FILES_XML="
+$SRC_H5DUMP_TESTFILES/tall.h5.xml
+$SRC_H5DUMP_TESTFILES/tall-2A.h5.xml
+$SRC_H5DUMP_TESTFILES/tarray1.h5.xml
+$SRC_H5DUMP_TESTFILES/tarray2.h5.xml
+$SRC_H5DUMP_TESTFILES/tarray3.h5.xml
+$SRC_H5DUMP_TESTFILES/tarray6.h5.xml
+$SRC_H5DUMP_TESTFILES/tarray7.h5.xml
+$SRC_H5DUMP_TESTFILES/tattr.h5.xml
+$SRC_H5DUMP_TESTFILES/tbitfields.h5.xml
+$SRC_H5DUMP_TESTFILES/tcompound_complex.h5.xml
+$SRC_H5DUMP_TESTFILES/tcompound.h5.xml
+$SRC_H5DUMP_TESTFILES/tcompound2.h5.xml
+$SRC_H5DUMP_TESTFILES/tdatareg.h5.xml
+$SRC_H5DUMP_TESTFILES/tdset.h5.xml
+$SRC_H5DUMP_TESTFILES/tdset2.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-dtd.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-dtd-2.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-dtd-uri.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-nons.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-nons-2.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-nons-uri.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-ns.h5.xml
+$SRC_H5DUMP_TESTFILES/tempty-ns-2.h5.xml
+$SRC_H5DUMP_TESTFILES/tenum.h5.xml
+$SRC_H5DUMP_TESTFILES/textlink.h5.xml
+$SRC_H5DUMP_TESTFILES/tfpformat.h5.xml
+$SRC_H5DUMP_TESTFILES/tgroup.h5.xml
+$SRC_H5DUMP_TESTFILES/thlink.h5.xml
+$SRC_H5DUMP_TESTFILES/tloop.h5.xml
+$SRC_H5DUMP_TESTFILES/tloop2.h5.xml
+$SRC_H5DUMP_TESTFILES/tmany.h5.xml
+$SRC_H5DUMP_TESTFILES/tname-amp.h5.xml
+$SRC_H5DUMP_TESTFILES/tname-apos.h5.xml
+$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5.xml
+$SRC_H5DUMP_TESTFILES/tname-gt.h5.xml
+$SRC_H5DUMP_TESTFILES/tname-lt.h5.xml
+$SRC_H5DUMP_TESTFILES/tname-quot.h5.xml
+$SRC_H5DUMP_TESTFILES/tname-sp.h5.xml
+$SRC_H5DUMP_TESTFILES/tnestedcomp.h5.xml
+$SRC_H5DUMP_TESTFILES/tnodata.h5.xml
+$SRC_H5DUMP_TESTFILES/tobjref.h5.xml
+$SRC_H5DUMP_TESTFILES/topaque.h5.xml
+$SRC_H5DUMP_TESTFILES/torderattr1.h5.xml
+$SRC_H5DUMP_TESTFILES/torderattr2.h5.xml
+$SRC_H5DUMP_TESTFILES/torderattr3.h5.xml
+$SRC_H5DUMP_TESTFILES/torderattr4.h5.xml
+$SRC_H5DUMP_TESTFILES/tref.h5.xml
+$SRC_H5DUMP_TESTFILES/tref-escapes.h5.xml
+$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5.xml
+$SRC_H5DUMP_TESTFILES/tsaf.h5.xml
+$SRC_H5DUMP_TESTFILES/tslink.h5.xml
+$SRC_H5DUMP_TESTFILES/tstr.h5.xml
+$SRC_H5DUMP_TESTFILES/tstr2.h5.xml
+$SRC_H5DUMP_TESTFILES/tstring.h5.xml
+$SRC_H5DUMP_TESTFILES/tstring-at.h5.xml
+$SRC_H5DUMP_TESTFILES/tudlink.h5.xml
+$SRC_H5DUMP_TESTFILES/tvldtypes1.h5.xml
+$SRC_H5DUMP_TESTFILES/tvldtypes2.h5.xml
+$SRC_H5DUMP_TESTFILES/tvldtypes3.h5.xml
+$SRC_H5DUMP_TESTFILES/tvldtypes4.h5.xml
+$SRC_H5DUMP_TESTFILES/tvldtypes5.h5.xml
+$SRC_H5DUMP_TESTFILES/tvlstr.h5.xml
+"
+
+#
+# copy test files and expected output files from source dirs to test dir
+#
+COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML"
+
+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 line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
@@ -71,9 +474,9 @@ TESTING() {
# non-zero value.
#
TOOLTEST() {
- expect="$srcdir/../testfiles/$1"
- actual="../testfiles/`basename $1 .ddl`.out"
- actual_err="../testfiles/`basename $1 .ddl`.err"
+ expect="$TESTDIR/$1"
+ actual="$TESTDIR/`basename $1 .ddl`.out"
+ actual_err="$TESTDIR/`basename $1 .ddl`.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -81,7 +484,7 @@ TOOLTEST() {
# Run test.
TESTING $DUMPER $@
(
- cd $srcdir/../testfiles
+ cd $TESTDIR
$RUNSERIAL $DUMPER_BIN $@
) >$actual 2>$actual_err
@@ -118,18 +521,17 @@ TOOLTEST() {
# used for the binary tests that expect a full path in -o without -b
TOOLTEST2() {
- expectdata="$srcdir/../testfiles/$1"
- expect="$srcdir/../testfiles/`basename $1 .exp`.ddl"
- actualdata="../testfiles/`basename $1 .exp`.txt"
- actual="../testfiles/`basename $1 .exp`.out"
- actual_err="../testfiles/`basename $1 .exp`.err"
+ expectdata="$TESTDIR/$1"
+ expect="$TESTDIR/`basename $1 .exp`.ddl"
+ actualdata="$TESTDIR/`basename $1 .exp`.txt"
+ actual="$TESTDIR/`basename $1 .exp`.out"
+ actual_err="$TESTDIR/`basename $1 .exp`.err"
shift
# Run test.
TESTING $DUMPER $@
(
-
- cd $srcdir/../testfiles
+ cd $TESTDIR
$RUNSERIAL $DUMPER_BIN $@
) >$actual 2>$actual_err
cat $actual_err >> $actual
@@ -169,10 +571,10 @@ TOOLTEST2() {
# Extract file name, line number, version and thread IDs because they may be different
TOOLTEST3() {
- expect="$srcdir/../testfiles/$1"
- actual="../testfiles/`basename $1 .ddl`.out"
- actual_err="../testfiles/`basename $1 .ddl`.err"
- actual_ext="../testfiles/`basename $1 .ddl`.ext"
+ expect="$TESTDIR/$1"
+ actual="$TESTDIR/`basename $1 .ddl`.out"
+ actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ actual_ext="$TESTDIR/`basename $1 .ddl`.ext"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -180,7 +582,7 @@ TOOLTEST3() {
# Run test.
TESTING $DUMPER $@
(
- cd $srcdir/../testfiles
+ cd $TESTDIR
$RUNSERIAL $DUMPER_BIN $@
) >$actual 2>$actual_err
@@ -240,7 +642,7 @@ DIFFTEST()
{
PRINT_H5DIFF $@
(
- cd $srcdir/../testfiles
+ cd $TESTDIR
$RUNSERIAL $H5DIFF_BIN "$@" -q
)
RET=$?
@@ -266,14 +668,14 @@ PRINT_H5IMPORT() {
IMPORTTEST()
{
# remove the output hdf5 file if it exists
- hdf5_file="$srcdir/../testfiles/$5"
+ hdf5_file="$TESTDIR/$5"
if [ -f $hdf5_file ]; then
rm -f $hdf5_file
fi
PRINT_H5IMPORT $@
(
- cd $srcdir/../testfiles
+ cd $TESTDIR
$RUNSERIAL $H5IMPORT_BIN "$@"
)
RET=$?
@@ -292,6 +694,8 @@ IMPORTTEST()
### T H E T E S T S ###
##############################################################################
##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
# test for signed/unsigned datasets
TOOLTEST packedbits.ddl packedbits.h5
@@ -408,7 +812,7 @@ TOOLTEST tchar1.ddl -r tchar.h5
# test failure handling
# Missing file name
- TOOLTEST tnofilename-with-packed-bits.ddl
+TOOLTEST tnofilename-with-packed-bits.ddl
# rev. 2004
@@ -547,27 +951,27 @@ TOOLTEST zerodim.ddl zerodim.h5
TOOLTEST tvms.ddl tvms.h5
# test for binary output
-TOOLTEST tbin1.ddl -d integer -o $TESTDIR/out1.bin -b LE tbinary.h5
+TOOLTEST tbin1.ddl -d integer -o out1.bin -b LE tbinary.h5
# NATIVE default. the NATIVE test can be validated with h5import/h5diff
-TOOLTEST tbin1.ddl -d integer -o $TESTDIR/out1.bin -b tbinary.h5
-IMPORTTEST $TESTDIR/out1.bin -c out3.h5import -o $TESTDIR/out1.h5
-DIFFTEST tbinary.h5 $TESTDIR/out1.h5 /integer /integer
+TOOLTEST tbin1.ddl -d integer -o out1.bin -b tbinary.h5
+IMPORTTEST out1.bin -c out3.h5import -o out1.h5
+DIFFTEST tbinary.h5 out1.h5 /integer /integer
-TOOLTEST tbin2.ddl -b BE -d float -o $TESTDIR/out2.bin tbinary.h5
+TOOLTEST tbin2.ddl -b BE -d float -o out2.bin tbinary.h5
# the NATIVE test can be validated with h5import/h5diff
-TOOLTEST tbin3.ddl -d integer -o $TESTDIR/out3.bin -b NATIVE tbinary.h5
-IMPORTTEST $TESTDIR/out3.bin -c out3.h5import -o $TESTDIR/out3.h5
-DIFFTEST tbinary.h5 $TESTDIR/out3.h5 /integer /integer
+TOOLTEST tbin3.ddl -d integer -o out3.bin -b NATIVE tbinary.h5
+IMPORTTEST out3.bin -c out3.h5import -o out3.h5
+DIFFTEST tbinary.h5 out3.h5 /integer /integer
-TOOLTEST tbin4.ddl -d double -b FILE -o $TESTDIR/out4.bin tbinary.h5
+TOOLTEST tbin4.ddl -d double -b FILE -o out4.bin tbinary.h5
# Clean up binary output files
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $TESTDIR/out[1-4].bin
- rm -f $TESTDIR/out1.h5
- rm -f $TESTDIR/out3.h5
+ rm -f out[1-4].bin
+ rm -f out1.h5
+ rm -f out3.h5
fi
# test for dataset region references
@@ -576,11 +980,11 @@ TOOLTEST tdataregR.ddl -R tdatareg.h5
TOOLTEST tattrreg.ddl tattrreg.h5
TOOLTEST tattrregR.ddl -R tattrreg.h5
-TOOLTEST2 tbinregR.exp -d /Dataset1 -s 0 -R -y -o $TESTDIR/tbinregR.txt tdatareg.h5
+TOOLTEST2 tbinregR.exp -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5
# Clean up text output files
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $TESTDIR/tbinregR.txt
+ rm -f tbinregR.txt
fi
# tests for group creation order
@@ -611,7 +1015,7 @@ TOOLTEST textlink.ddl textlink.h5
TOOLTEST3 filter_fail.ddl --enable-error-stack filter_fail.h5
# test for -o -y for dataset with attributes
-TOOLTEST tall-6.ddl -y -o $TESTDIR/data -d /g1/g1.1/dset1.1.1 tall.h5
+TOOLTEST tall-6.ddl -y -o data -d /g1/g1.1/dset1.1.1 tall.h5
# test for dataset packed bits
# Limits:
diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh
index 6dbec84..a3ad057 100755
--- a/tools/h5import/h5importtestutil.sh
+++ b/tools/h5import/h5importtestutil.sh
@@ -20,9 +20,112 @@ TESTNAME=h5import
EXIT_SUCCESS=0
EXIT_FAILURE=1
+CP='cp'
+
# initialize errors variable
nerrors=0
+# 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"
+
+TESTDIR=./testfiles
+test -d $TESTDIR || mkdir $TESTDIR
+
+######################################################################
+# 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_HDF5_TEST_FILES="
+$SRC_H5IMPORT_TESTFILES/binfp64.h5
+$SRC_H5IMPORT_TESTFILES/binin8.h5
+$SRC_H5IMPORT_TESTFILES/binin8w.h5
+$SRC_H5IMPORT_TESTFILES/binin16.h5
+$SRC_H5IMPORT_TESTFILES/binin32.h5
+$SRC_H5IMPORT_TESTFILES/binuin16.h5
+$SRC_H5IMPORT_TESTFILES/binuin32.h5
+$SRC_H5IMPORT_TESTFILES/txtfp32.h5
+$SRC_H5IMPORT_TESTFILES/txtfp64.h5
+$SRC_H5IMPORT_TESTFILES/txtin8.h5
+$SRC_H5IMPORT_TESTFILES/txtin16.h5
+$SRC_H5IMPORT_TESTFILES/txtin32.h5
+$SRC_H5IMPORT_TESTFILES/txtuin16.h5
+$SRC_H5IMPORT_TESTFILES/txtuin32.h5
+$SRC_H5IMPORT_TESTFILES/txtstr.h5
+$SRC_H5IMPORT_TESTFILES/test15.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5IMPORT_TESTFILES/binfp64.conf
+$SRC_H5IMPORT_TESTFILES/binin8.conf
+$SRC_H5IMPORT_TESTFILES/binin8w.conf
+$SRC_H5IMPORT_TESTFILES/binin16.conf
+$SRC_H5IMPORT_TESTFILES/binin32.conf
+$SRC_H5IMPORT_TESTFILES/binuin16.conf
+$SRC_H5IMPORT_TESTFILES/binuin32.conf
+$SRC_H5IMPORT_TESTFILES/txtfp32.conf
+$SRC_H5IMPORT_TESTFILES/txtfp64.conf
+$SRC_H5IMPORT_TESTFILES/txtin8.conf
+$SRC_H5IMPORT_TESTFILES/txtin16.conf
+$SRC_H5IMPORT_TESTFILES/txtin32.conf
+$SRC_H5IMPORT_TESTFILES/txtuin16.conf
+$SRC_H5IMPORT_TESTFILES/txtuin32.conf
+$SRC_H5IMPORT_TESTFILES/textpfe.conf
+$SRC_H5IMPORT_TESTFILES/txtstr.conf
+$SRC_H5IMPORT_TESTFILES/txtfp32.txt
+$SRC_H5IMPORT_TESTFILES/txtfp64.txt
+$SRC_H5IMPORT_TESTFILES/txtuin32.txt
+$SRC_H5IMPORT_TESTFILES/txtin16.txt
+$SRC_H5IMPORT_TESTFILES/txtin32.txt
+$SRC_H5IMPORT_TESTFILES/in64.txt
+$SRC_H5IMPORT_TESTFILES/txtstr.txt
+"
+
+#
+# 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
+}
+
TESTING() {
SPACES=" "
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
@@ -58,65 +161,72 @@ if [ -f h5import -a -f h5importtest ]; then
rm -f output.h5 log1 tx* b* *.dat
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
+
mkdir tmp_testfiles
-cp $srcdir/testfiles/*.h5 tmp_testfiles/
+$CP $TESTDIR/*.h5 ./tmp_testfiles/
$RUNSERIAL ./h5importtest
+################################################
+### T H E T E S T S
+################################################
+
TESTING "ASCII I32 rank 3 - Output BE " ;
-TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin32.conf -o txtin32.h5
+TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin32.conf -o txtin32.h5
TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended"
-TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5
+TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin16.conf -o txtin16.h5
TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed "
-TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin8.conf -o txtin8.h5
+TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin8.conf -o txtin8.h5
TESTING "ASCII UI32 - rank 3 - Output BE"
-TOOLTEST $srcdir/testfiles/txtuin32.txt -c $srcdir/testfiles/txtuin32.conf -o txtuin32.h5
+TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5
TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed "
-TOOLTEST $srcdir/testfiles/txtuin32.txt -c $srcdir/testfiles/txtuin16.conf -o txtuin16.h5
+TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin16.conf -o txtuin16.h5
TESTING "ASCII F32 - rank 3 - Output LE "
-TOOLTEST $srcdir/testfiles/txtfp32.txt -c $srcdir/testfiles/txtfp32.conf -o txtfp32.h5
+TOOLTEST $TESTDIR/txtfp32.txt -c $TESTDIR/txtfp32.conf -o txtfp32.h5
TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed "
-TOOLTEST $srcdir/testfiles/txtfp64.txt -c $srcdir/testfiles/txtfp64.conf -o txtfp64.h5
+TOOLTEST $TESTDIR/txtfp64.txt -c $TESTDIR/txtfp64.conf -o txtfp64.h5
TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed "
-TOOLTEST binfp64.bin -c $srcdir/testfiles/binfp64.conf -o binfp64.h5
+TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o binfp64.h5
TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended "
-TOOLTEST binin16.bin -c $srcdir/testfiles/binin16.conf -o binin16.h5
+TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5
TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed "
-TOOLTEST binin8.bin -c $srcdir/testfiles/binin8.conf -o binin8.h5
+TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5
TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED "
-TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5
+TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o binin32.h5
TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED "
-TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5
+TOOLTEST binuin16.bin -c $TESTDIR/binuin16.conf -o binuin16.h5
TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED "
-TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5
+TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o binuin32.h5
TESTING "STR"
-TOOLTEST $srcdir/testfiles/txtstr.txt -c $srcdir/testfiles/txtstr.conf -o txtstr.h5
+TOOLTEST $TESTDIR/txtstr.txt -c $TESTDIR/txtstr.conf -o txtstr.h5
TESTING "BINARY I8 CR LF EOF"
-TOOLTEST binin8w.bin -c $srcdir/testfiles/binin8w.conf -o binin8w.h5
+TOOLTEST binin8w.bin -c $TESTDIR/binin8w.conf -o binin8w.h5
TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE "
-TOOLTEST $srcdir/testfiles/in64.txt -c $srcdir/testfiles/textpfe.conf -o test15.h5
+TOOLTEST $TESTDIR/in64.txt -c $TESTDIR/textpfe.conf -o test15.h5
diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in
index cfefcdc..4508767 100644
--- a/tools/h5jam/testh5jam.sh.in
+++ b/tools/h5jam/testh5jam.sh.in
@@ -35,6 +35,7 @@ UNJAM_BIN=`pwd` # The path of the jam binary
CMP='cmp -s'
DIFF='diff -c'
AWK='awk'
+CP='cp'
nerrors=0
verbose=yes
@@ -43,15 +44,79 @@ verbose=yes
if test -z "$srcdir"; then
srcdir=.
fi
-TESTFILES="$srcdir/testfiles"
+# 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"
+
+TESTDIR=./testfiles
+test -d $TESTDIR || mkdir $TESTDIR
+
+######################################################################
+# 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_HDF5_TEST_FILES="
+$SRC_H5JAM_TESTFILES/tall.h5
+$SRC_H5JAM_TESTFILES/twithub.h5
+$SRC_H5JAM_TESTFILES/twithub513.h5
+"
+LIST_OTHER_TEST_FILES="
+$SRC_H5JAM_TESTFILES/u10.txt
+$SRC_H5JAM_TESTFILES/u511.txt
+$SRC_H5JAM_TESTFILES/u512.txt
+$SRC_H5JAM_TESTFILES/u513.txt
+$SRC_H5JAM_TESTFILES/h5jam-help.txt
+$SRC_H5JAM_TESTFILES/h5unjam-help.txt
+"
+
+#
+# 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 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'
+ echo "Testing $* $SPACES"
+ #echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
}
# Print a line-line message left justified in a field of 70 characters
@@ -386,145 +451,148 @@ UNJAMTEST () {
### T H E T E S T S ###
##############################################################################
##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
-JAMTEST $TESTFILES/u10.txt $TESTFILES/tall.h5 ta2.h5
-CHECKFILE $TESTFILES/tall.h5 ta2.h5
+# test start
+JAMTEST $TESTDIR/u10.txt $TESTDIR/tall.h5 ta2.h5
+CHECKFILE $TESTDIR/tall.h5 ta2.h5
CLEANUP ta2.h5
-JAMTEST $TESTFILES/u511.txt $TESTFILES/tall.h5 ta3.h5
-CHECKFILE $TESTFILES/tall.h5 ta3.h5
+JAMTEST $TESTDIR/u511.txt $TESTDIR/tall.h5 ta3.h5
+CHECKFILE $TESTDIR/tall.h5 ta3.h5
CLEANUP ta3.h5
-JAMTEST $TESTFILES/u512.txt $TESTFILES/tall.h5 ta4.h5
-CHECKFILE $TESTFILES/tall.h5 ta4.h5
+JAMTEST $TESTDIR/u512.txt $TESTDIR/tall.h5 ta4.h5
+CHECKFILE $TESTDIR/tall.h5 ta4.h5
CLEANUP ta4.h5
-JAMTEST $TESTFILES/u513.txt $TESTFILES/tall.h5 ta5.h5
-CHECKFILE $TESTFILES/tall.h5 ta5.h5
+JAMTEST $TESTDIR/u513.txt $TESTDIR/tall.h5 ta5.h5
+CHECKFILE $TESTDIR/tall.h5 ta5.h5
CLEANUP ta5.h5
-SETUP $TESTFILES/tall.h5 ta.h5
-JAMTEST $TESTFILES/u10.txt ta.h5
-CHECKFILE $TESTFILES/tall.h5 ta.h5
-SETUP $TESTFILES/tall.h5 ta.h5
-JAMTEST $TESTFILES/u511.txt ta.h5
-CHECKFILE $TESTFILES/tall.h5 ta.h5
-SETUP $TESTFILES/tall.h5 ta.h5
-JAMTEST $TESTFILES/u512.txt ta.h5
-CHECKFILE $TESTFILES/tall.h5 ta.h5
-SETUP $TESTFILES/tall.h5 ta.h5
-JAMTEST $TESTFILES/u513.txt ta.h5
-CHECKFILE $TESTFILES/tall.h5 ta.h5
+SETUP $TESTDIR/tall.h5 ta.h5
+JAMTEST $TESTDIR/u10.txt ta.h5
+CHECKFILE $TESTDIR/tall.h5 ta.h5
+SETUP $TESTDIR/tall.h5 ta.h5
+JAMTEST $TESTDIR/u511.txt ta.h5
+CHECKFILE $TESTDIR/tall.h5 ta.h5
+SETUP $TESTDIR/tall.h5 ta.h5
+JAMTEST $TESTDIR/u512.txt ta.h5
+CHECKFILE $TESTDIR/tall.h5 ta.h5
+SETUP $TESTDIR/tall.h5 ta.h5
+JAMTEST $TESTDIR/u513.txt ta.h5
+CHECKFILE $TESTDIR/tall.h5 ta.h5
CLEANUP ta.h5
-JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub.h5 tax2.h5
-CHECKFILE $TESTFILES/tall.h5 tax2.h5
+JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 tax2.h5
+CHECKFILE $TESTDIR/tall.h5 tax2.h5
CLEANUP tax2.h5
-JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub.h5 tax3.h5
-CHECKFILE $TESTFILES/tall.h5 tax3.h5
+JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub.h5 tax3.h5
+CHECKFILE $TESTDIR/tall.h5 tax3.h5
CLEANUP tax3.h5
-JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub.h5 tax4.h5
-CHECKFILE $TESTFILES/tall.h5 tax4.h5
+JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 tax4.h5
+CHECKFILE $TESTDIR/tall.h5 tax4.h5
CLEANUP tax4.h5
-JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub.h5 tax5.h5
-CHECKFILE $TESTFILES/tall.h5 tax5.h5
+JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 tax5.h5
+CHECKFILE $TESTDIR/tall.h5 tax5.h5
CLEANUP tax5.h5
-JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub513.h5 tax6.h5
-CHECKFILE $TESTFILES/tall.h5 tax6.h5
+JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 tax6.h5
+CHECKFILE $TESTDIR/tall.h5 tax6.h5
CLEANUP tax6.h5
-JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub513.h5 tax7.h5
-CHECKFILE $TESTFILES/tall.h5 tax7.h5
+JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub513.h5 tax7.h5
+CHECKFILE $TESTDIR/tall.h5 tax7.h5
CLEANUP tax7.h5
-JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub513.h5 tax8.h5
-CHECKFILE $TESTFILES/tall.h5 tax8.h5
+JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 tax8.h5
+CHECKFILE $TESTDIR/tall.h5 tax8.h5
CLEANUP tax8.h5
-JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub513.h5 tax9.h5
-CHECKFILE $TESTFILES/tall.h5 tax9.h5
+JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 tax9.h5
+CHECKFILE $TESTDIR/tall.h5 tax9.h5
CLEANUP tax9.h5
-JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub.h5 --clobber taz2.h5
-CHECKFILE $TESTFILES/tall.h5 taz2.h5
+JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 --clobber taz2.h5
+CHECKFILE $TESTDIR/tall.h5 taz2.h5
CLEANUP taz2.h5
-JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub.h5 --clobber taz3.h5
-CHECKFILE $TESTFILES/tall.h5 taz3.h5
+JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub.h5 --clobber taz3.h5
+CHECKFILE $TESTDIR/tall.h5 taz3.h5
CLEANUP taz3.h5
-JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub.h5 --clobber taz4.h5
-CHECKFILE $TESTFILES/tall.h5 taz4.h5
+JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 --clobber taz4.h5
+CHECKFILE $TESTDIR/tall.h5 taz4.h5
CLEANUP taz4.h5
-JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub.h5 --clobber taz5.h5
-CHECKFILE $TESTFILES/tall.h5 taz5.h5
+JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5
+CHECKFILE $TESTDIR/tall.h5 taz5.h5
CLEANUP taz5.h5
-JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub513.h5 --clobber taz6.h5
-CHECKFILE $TESTFILES/tall.h5 taz6.h5
+JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 --clobber taz6.h5
+CHECKFILE $TESTDIR/tall.h5 taz6.h5
CLEANUP taz6.h5
-JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub513.h5 --clobber taz7.h5
-CHECKFILE $TESTFILES/tall.h5 taz7.h5
+JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub513.h5 --clobber taz7.h5
+CHECKFILE $TESTDIR/tall.h5 taz7.h5
CLEANUP taz7.h5
-JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub513.h5 --clobber taz8.h5
-CHECKFILE $TESTFILES/tall.h5 taz8.h5
+JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 --clobber taz8.h5
+CHECKFILE $TESTDIR/tall.h5 taz8.h5
CLEANUP taz8.h5
-JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub513.h5 --clobber taz9.h5
-CHECKFILE $TESTFILES/tall.h5 taz9.h5
+JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 --clobber taz9.h5
+CHECKFILE $TESTDIR/tall.h5 taz9.h5
CLEANUP taz9.h5
-SETUP $TESTFILES/twithub.h5 tay2.h5
-JAMTEST $TESTFILES/u10.txt tay2.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay2.h5
+SETUP $TESTDIR/twithub.h5 tay2.h5
+JAMTEST $TESTDIR/u10.txt tay2.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay2.h5
CLEANUP tay2.h5
-SETUP $TESTFILES/twithub.h5 tay3.h5
-JAMTEST $TESTFILES/u511.txt tay3.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay3.h5
+SETUP $TESTDIR/twithub.h5 tay3.h5
+JAMTEST $TESTDIR/u511.txt tay3.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay3.h5
CLEANUP tay3.h5
-SETUP $TESTFILES/twithub.h5 tay4.h5
-JAMTEST $TESTFILES/u512.txt tay4.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay4.h5
+SETUP $TESTDIR/twithub.h5 tay4.h5
+JAMTEST $TESTDIR/u512.txt tay4.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay4.h5
CLEANUP tay4.h5
-SETUP $TESTFILES/twithub.h5 tay5.h5
-JAMTEST $TESTFILES/u513.txt tay5.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay5.h5
+SETUP $TESTDIR/twithub.h5 tay5.h5
+JAMTEST $TESTDIR/u513.txt tay5.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay5.h5
CLEANUP tay5.h5
-SETUP $TESTFILES/twithub513.h5 tay6.h5
-JAMTEST $TESTFILES/u10.txt tay6.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay6.h5
+SETUP $TESTDIR/twithub513.h5 tay6.h5
+JAMTEST $TESTDIR/u10.txt tay6.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay6.h5
CLEANUP tay6.h5
-SETUP $TESTFILES/twithub513.h5 tay7.h5
-JAMTEST $TESTFILES/u511.txt tay7.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay7.h5
+SETUP $TESTDIR/twithub513.h5 tay7.h5
+JAMTEST $TESTDIR/u511.txt tay7.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay7.h5
CLEANUP tay7.h5
-SETUP $TESTFILES/twithub513.h5 tay8.h5
-JAMTEST $TESTFILES/u512.txt tay8.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay8.h5
+SETUP $TESTDIR/twithub513.h5 tay8.h5
+JAMTEST $TESTDIR/u512.txt tay8.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay8.h5
CLEANUP tay8.h5
-SETUP $TESTFILES/twithub513.h5 tay9.h5
-JAMTEST $TESTFILES/u513.txt tay9.h5 --clobber
-CHECKFILE $TESTFILES/tall.h5 tay9.h5
+SETUP $TESTDIR/twithub513.h5 tay9.h5
+JAMTEST $TESTDIR/u513.txt tay9.h5 --clobber
+CHECKFILE $TESTDIR/tall.h5 tay9.h5
CLEANUP tay9.h5
-SETUP $TESTFILES/twithub.h5 tai1.h5
+SETUP $TESTDIR/twithub.h5 tai1.h5
UNJAMTEST tai1.h5 o10.txt taa1.h5
-CHECKFILE $TESTFILES/tall.h5 taa1.h5
+CHECKFILE $TESTDIR/tall.h5 taa1.h5
CLEANUP taa1.h5 tai1.h5 o10.txt
-SETUP $TESTFILES/twithub513.h5 tai2.h5
+SETUP $TESTDIR/twithub513.h5 tai2.h5
UNJAMTEST tai2.h5 o512.txt taa2.h5
-CHECKFILE $TESTFILES/tall.h5 taa2.h5
+CHECKFILE $TESTDIR/tall.h5 taa2.h5
CLEANUP taa2.h5 tai2.h5 o512.txt
-SETUP $TESTFILES/twithub.h5 tai3.h5
+SETUP $TESTDIR/twithub.h5 tai3.h5
UNJAMTEST tai3.h5 - taa3.h5
-CHECKFILE $TESTFILES/tall.h5 taa3.h5
+CHECKFILE $TESTDIR/tall.h5 taa3.h5
CLEANUP taa3.h5 tai3.h5
-SETUP $TESTFILES/twithub513.h5 tai4.h5
+SETUP $TESTDIR/twithub513.h5 tai4.h5
UNJAMTEST tai4.h5 - taa4.h5
-CHECKFILE $TESTFILES/tall.h5 taa4.h5
+CHECKFILE $TESTDIR/tall.h5 taa4.h5
CLEANUP taa4.h5 tai4.h5
-SETUP $TESTFILES/twithub.h5 taj2.h5
+SETUP $TESTDIR/twithub.h5 taj2.h5
UNJAMTEST taj2.h5 --delete tac2.h5
-CHECKFILE $TESTFILES/tall.h5 tac2.h5
+CHECKFILE $TESTDIR/tall.h5 tac2.h5
CLEANUP tac2.h5 taj2.h5
-SETUP $TESTFILES/twithub513.h5 taj3.h5
+SETUP $TESTDIR/twithub513.h5 taj3.h5
UNJAMTEST taj3.h5 --delete tac3.h5
-CHECKFILE $TESTFILES/tall.h5 tac3.h5
+CHECKFILE $TESTDIR/tall.h5 tac3.h5
CLEANUP tac3.h5 taj3.h5
diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in
index 798700b..bdf0af7 100644
--- a/tools/h5ls/testh5ls.sh.in
+++ b/tools/h5ls/testh5ls.sh.in
@@ -24,6 +24,7 @@ H5LS_BIN=`pwd`/$H5LS # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
+CP='cp'
NLINES=20 # Max. lines of output to display if test fails
WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
@@ -31,12 +32,115 @@ WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
nerrors=0
verbose=yes
h5haveexitcode=yes # default is yes
-
# The build (current) directory might be different than the source directory.
if test -z "$srcdir"; then
srcdir=.
fi
-test -d ../testfiles || mkdir ../testfiles
+# 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"
+
+TESTDIR=./testfiles
+test -d $TESTDIR || mkdir $TESTDIR
+
+######################################################################
+# 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_HDF5_TEST_FILES="
+$SRC_H5LS_TESTFILES/tall.h5
+$SRC_H5LS_TESTFILES/tarray1.h5
+$SRC_H5LS_TESTFILES/tattr2.h5
+$SRC_H5LS_TESTFILES/tcompound.h5
+$SRC_H5LS_TESTFILES/tdatareg.h5
+$SRC_H5LS_TESTFILES/tdset.h5
+$SRC_H5LS_TESTFILES/tempty.h5
+$SRC_H5LS_TESTFILES/textlink.h5
+$SRC_H5LS_TESTFILES/textlinksrc.h5
+$SRC_H5LS_TESTFILES/textlinktar.h5
+$SRC_H5LS_TESTFILES/tgroup.h5
+$SRC_H5LS_TESTFILES/tgrp_comments.h5
+$SRC_H5LS_TESTFILES/thlink.h5
+$SRC_H5LS_TESTFILES/tloop.h5
+$SRC_H5LS_TESTFILES/tnestedcomp.h5
+$SRC_H5LS_TESTFILES/tsaf.h5
+$SRC_H5LS_TESTFILES/tslink.h5
+$SRC_H5LS_TESTFILES/tsoftlinks.h5
+$SRC_H5LS_TESTFILES/tstr.h5
+$SRC_H5LS_TESTFILES/tudlink.h5
+$SRC_H5LS_TESTFILES/tvldtypes1.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5LS_TESTFILES/help-1.ls
+$SRC_H5LS_TESTFILES/help-2.ls
+$SRC_H5LS_TESTFILES/help-3.ls
+$SRC_H5LS_TESTFILES/nosuchfile.ls
+$SRC_H5LS_TESTFILES/tall-1.ls
+$SRC_H5LS_TESTFILES/tall-2.ls
+$SRC_H5LS_TESTFILES/tarray1.ls
+$SRC_H5LS_TESTFILES/tattr2.ls
+$SRC_H5LS_TESTFILES/tcomp-1.ls
+$SRC_H5LS_TESTFILES/tdataregbe.ls
+$SRC_H5LS_TESTFILES/tdataregle.ls
+$SRC_H5LS_TESTFILES/tdset-1.ls
+$SRC_H5LS_TESTFILES/tempty.ls
+$SRC_H5LS_TESTFILES/textlink-1.ls
+$SRC_H5LS_TESTFILES/textlinksrc-1.ls
+$SRC_H5LS_TESTFILES/textlinksrc-2.ls
+$SRC_H5LS_TESTFILES/textlinksrc-3.ls
+$SRC_H5LS_TESTFILES/textlinksrc-4.ls
+$SRC_H5LS_TESTFILES/textlinksrc-5.ls
+$SRC_H5LS_TESTFILES/textlinksrc-6.ls
+$SRC_H5LS_TESTFILES/textlinksrc-7.ls
+$SRC_H5LS_TESTFILES/textlinksrc-1-old.ls
+$SRC_H5LS_TESTFILES/textlinksrc-2-old.ls
+$SRC_H5LS_TESTFILES/textlinksrc-3-old.ls
+$SRC_H5LS_TESTFILES/textlinksrc-6-old.ls
+$SRC_H5LS_TESTFILES/textlinksrc-7-old.ls
+$SRC_H5LS_TESTFILES/tsoftlinks-1.ls
+$SRC_H5LS_TESTFILES/tsoftlinks-2.ls
+$SRC_H5LS_TESTFILES/tsoftlinks-3.ls
+$SRC_H5LS_TESTFILES/tsoftlinks-4.ls
+$SRC_H5LS_TESTFILES/tsoftlinks-5.ls
+$SRC_H5LS_TESTFILES/textlinksrc-nodangle-1.ls
+$SRC_H5LS_TESTFILES/textlinksrc-nodangle-2.ls
+$SRC_H5LS_TESTFILES/tgrp_comments.ls
+$SRC_H5LS_TESTFILES/tsoftlinks-nodangle-1.ls
+$SRC_H5LS_TESTFILES/thlinks-nodangle-1.ls
+$SRC_H5LS_TESTFILES/tgroup.ls
+$SRC_H5LS_TESTFILES/tgroup-1.ls
+$SRC_H5LS_TESTFILES/tgroup-2.ls
+$SRC_H5LS_TESTFILES/tgroup-3.ls
+$SRC_H5LS_TESTFILES/thlink-1.ls
+$SRC_H5LS_TESTFILES/tloop-1.ls
+$SRC_H5LS_TESTFILES/tnestcomp-1.ls
+$SRC_H5LS_TESTFILES/tnestcomp-2.ls
+$SRC_H5LS_TESTFILES/tnestcomp-3.ls
+$SRC_H5LS_TESTFILES/tnestcomp-4.ls
+$SRC_H5LS_TESTFILES/tsaf.ls
+$SRC_H5LS_TESTFILES/tslink-1.ls
+$SRC_H5LS_TESTFILES/tstr-1.ls
+$SRC_H5LS_TESTFILES/tudlink-1.ls
+$SRC_H5LS_TESTFILES/tvldtypes1.ls
+$SRC_H5LS_TESTFILES/tvldtypes2le.ls
+$SRC_H5LS_TESTFILES/tvldtypes2be.ls
+"
+
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
@@ -45,6 +149,31 @@ if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
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 line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
TESTING() {
@@ -64,9 +193,9 @@ TESTING() {
# $1 -- actual output filename to use
# $2 and on -- argument for the h5ls tool
TOOLTEST() {
- expect="$srcdir/../testfiles/$1"
- actual="../testfiles/`basename $1 .ls`.out"
- actual_err="../testfiles/`basename $1 .ls`.err"
+ expect="$TESTDIR/$1"
+ actual="$TESTDIR/`basename $1 .ls`.out"
+ actual_err="$TESTDIR/`basename $1 .ls`.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -78,7 +207,7 @@ TOOLTEST() {
# any unexpected output from that stream too.
TESTING $H5LS $@
(
- cd $srcdir/../testfiles
+ cd $TESTDIR
$RUNSERIAL $H5LS_BIN "$@"
) >$actual 2>$actual_err
@@ -123,6 +252,8 @@ TOOLTEST() {
### T H E T E S T S ###
##############################################################################
##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
# Toss in a bunch of tests. Not sure if they are the right kinds.
# test the help syntax
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index 5a60227..b0619a3 100755
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -41,33 +41,11 @@ H5DUMP=../h5dump/h5dump # The h5dump tool name
H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary
GREP='grep'
+CP='cp'
H5DETECTSZIP=testh5repack_detect_szip
H5DETECTSZIP_BIN=`pwd`/$H5DETECTSZIP
-INFO_FILE=testfiles/h5repack.info
-
-FILE0=h5repack_fill.h5
-FILE1=h5repack_objs.h5
-FILE2=h5repack_attr.h5
-FILE3=h5repack_hlink.h5
-FILE4=h5repack_layout.h5
-FILE5=h5repack_early.h5
-FILE7=h5repack_szip.h5
-FILE8=h5repack_deflate.h5
-FILE9=h5repack_shuffle.h5
-FILE10=h5repack_fletcher.h5
-FILE11=h5repack_filters.h5
-FILE12=h5repack_nbit.h5
-FILE13=h5repack_soffset.h5
-FILE14=h5repack_layouto.h5 # A file with an older version of the layout message
- # (copy of test/tlayouto.h5)
-FILE15=h5repack_named_dtypes.h5
-FILE16=tfamily%05d.h5 # located in common testfiles folder
-FILE18=h5repack_layout2.h5
-FILE_REF=h5repack_refs.h5
-FILE_ATTR_REF=h5repack_attr_refs.h5
-
nerrors=0
verbose=yes
@@ -78,7 +56,95 @@ 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"
+
+TESTDIR=./testfiles
+test -d $TESTDIR || mkdir $TESTDIR
+
+######################################################################
+# 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_HDF5_TEST_FILES="
+$SRC_H5REPACK_TESTFILES/h5repack_attr.h5
+$SRC_H5REPACK_TESTFILES/h5repack_attr_refs.h5
+$SRC_H5REPACK_TESTFILES/h5repack_deflate.h5
+$SRC_H5REPACK_TESTFILES/h5repack_early.h5
+$SRC_H5REPACK_TESTFILES/h5repack_ext.h5
+$SRC_H5REPACK_TESTFILES/h5repack_fill.h5
+$SRC_H5REPACK_TESTFILES/h5repack_filters.h5
+$SRC_H5REPACK_TESTFILES/h5repack_fletcher.h5
+$SRC_H5REPACK_TESTFILES/h5repack_hlink.h5
+$SRC_H5REPACK_TESTFILES/h5repack_layout.h5
+$SRC_H5REPACK_TESTFILES/h5repack_layouto.h5
+$SRC_H5REPACK_TESTFILES/h5repack_layout2.h5
+$SRC_H5REPACK_TESTFILES/h5repack_named_dtypes.h5
+$SRC_H5REPACK_TESTFILES/h5repack_nbit.h5
+$SRC_H5REPACK_TESTFILES/h5repack_objs.h5
+$SRC_H5REPACK_TESTFILES/h5repack_refs.h5
+$SRC_H5REPACK_TESTFILES/h5repack_shuffle.h5
+$SRC_H5REPACK_TESTFILES/h5repack_soffset.h5
+$SRC_H5REPACK_TESTFILES/h5repack_szip.h5
+$SRC_TOOLS_TESTFILES/tfamily00000.h5
+$SRC_TOOLS_TESTFILES/tfamily00001.h5
+$SRC_TOOLS_TESTFILES/tfamily00002.h5
+$SRC_TOOLS_TESTFILES/tfamily00003.h5
+$SRC_TOOLS_TESTFILES/tfamily00004.h5
+$SRC_TOOLS_TESTFILES/tfamily00005.h5
+$SRC_TOOLS_TESTFILES/tfamily00006.h5
+$SRC_TOOLS_TESTFILES/tfamily00007.h5
+$SRC_TOOLS_TESTFILES/tfamily00008.h5
+$SRC_TOOLS_TESTFILES/tfamily00009.h5
+$SRC_TOOLS_TESTFILES/tfamily00010.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5REPACK_TESTFILES/h5repack_ext.bin
+$SRC_H5REPACK_TESTFILES/ublock.bin
+$SRC_H5REPACK_TESTFILES/h5repack.info
+$SRC_TOOLS_TESTFILES/h5repack_filters.h5.ddl
+"
+#
+# 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 line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
@@ -128,8 +194,7 @@ TOOLTEST()
{
echo $@
TOOLTEST_MAIN $@
- path=`pwd`
- outfile=$path/out.$1
+ outfile=$TESTDIR/out.$1
rm -f $outfile
}
@@ -139,9 +204,8 @@ TOOLTEST_MAIN()
# Run test.
TESTING $H5REPACK $@
- infile=$srcdir/testfiles/$1
- path=`pwd`
- outfile=$path/out.$1
+ infile=$TESTDIR/$1
+ outfile=$TESTDIR/out.$1
shift
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
RET=$?
@@ -158,9 +222,8 @@ TOOLTEST_MAIN()
# Verifying layouts of a dataset
VERIFY_LAYOUT_DSET()
{
- path=`pwd`
- outfile=$path/out.$1
- layoutfile=$path/layout.$1
+ outfile=$TESTDIR/out.$1
+ layoutfile=$TESTDIR/layout.$1
dset=$2
expectlayout=$3
@@ -184,9 +247,8 @@ VERIFY_LAYOUT_DSET()
# Verifying layouts from entire file
VERIFY_LAYOUT_ALL()
{
- path=`pwd`
- outfile=$path/out.$1
- layoutfile=$path/layout.$1
+ outfile=$TESTDIR/out.$1
+ layoutfile=$TESTDIR/layout.$1
expectlayout=$2
#---------------------------------
@@ -253,9 +315,8 @@ TOOLTEST0()
# Run test.
TESTING $H5REPACK $@
- infile=$srcdir/testfiles/$1
- path=`pwd`
- outfile=$path/out.$1
+ infile=$TESTDIR/$1
+ outfile=$TESTDIR/out.$1
shift
$RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@"
RET=$?
@@ -270,7 +331,7 @@ TOOLTEST0()
}
-# same as TOOLTEST, but it uses the common testfiles at $srcdir/../testfiles/
+# same as TOOLTEST, but it uses without -i -o options
# used to test the family driver, where these files reside
#
TOOLTEST1()
@@ -278,9 +339,8 @@ TOOLTEST1()
# Run test.
TESTING $H5REPACK $@
- infile=$srcdir/../testfiles/$1
- path=`pwd`
- outfile=$path/out.$1
+ infile=$TESTDIR/$1
+ outfile=$TESTDIR/out.$1
shift
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
RET=$?
@@ -300,13 +360,12 @@ TOOLTESTV()
{
# Run test.
TESTING $H5REPACK $@
- expect="$srcdir/../testfiles/$1.ddl"
- actual="../testfiles/`basename $1 .ddl`.out"
- actual_err="../testfiles/`basename $1 .ddl`.err"
+ expect="$TESTDIR/$1.ddl"
+ actual="$TESTDIR/`basename $1 .ddl`.out"
+ actual_err="$TESTDIR/`basename $1 .ddl`.err"
- infile=$srcdir/testfiles/$1
- path=`pwd`
- outfile=$path/out.$1
+ infile=$TESTDIR/$1
+ outfile=$TESTDIR/out.$1
shift
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile >$actual 2>$actual_err
cp $actual $actual_sav
@@ -325,6 +384,7 @@ TOOLTESTV()
rm -f $actual $actual_err $actual_sav
}
+# This is different from $srcdir/../../bin/output_filter.sh
STDOUT_FILTER() {
result_file=$1
tmp_file=/tmp/h5test_tmp_$$
@@ -355,19 +415,25 @@ if test $USE_FILTER_SZIP = "yes"; then
USE_FILTER_SZIP_ENCODER=`$RUNSERIAL $H5DETECTSZIP_BIN`
fi
+##############################################################################
+### T H E T E S T S
+##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
+
# copy files (these files have no filters)
-TOOLTEST $FILE0
-TOOLTEST $FILE1
-TOOLTEST $FILE2
-TOOLTEST $FILE3
-TOOLTEST $FILE4
-TOOLTEST $FILE5
+TOOLTEST h5repack_fill.h5
+TOOLTEST h5repack_objs.h5
+TOOLTEST h5repack_attr.h5
+TOOLTEST h5repack_hlink.h5
+TOOLTEST h5repack_layout.h5
+TOOLTEST h5repack_early.h5
-# use $FILE4 to write some filters (this file has no filters)
+# use h5repack_layout.h5 to write some filters (this file has no filters)
# gzip with individual object
-arg="$FILE4 -f dset1:GZIP=1 -l dset1:CHUNK=20x10"
+arg="h5repack_layout.h5 -f dset1:GZIP=1 -l dset1:CHUNK=20x10"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -375,7 +441,7 @@ else
fi
# gzip for all
-arg="$FILE4 -f GZIP=1"
+arg="h5repack_layout.h5 -f GZIP=1"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -383,7 +449,7 @@ else
fi
# szip with individual object
-arg="$FILE4 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10"
+arg="h5repack_layout.h5 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
@@ -391,7 +457,7 @@ else
fi
# szip for all
-arg="$FILE4 -f SZIP=8,NN"
+arg="h5repack_layout.h5 -f SZIP=8,NN"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
@@ -399,7 +465,7 @@ else
fi
# shuffle with individual object
-arg="$FILE4 -f dset2:SHUF -l dset2:CHUNK=20x10"
+arg="h5repack_layout.h5 -f dset2:SHUF -l dset2:CHUNK=20x10"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
@@ -408,7 +474,7 @@ fi
# shuffle for all
-arg="$FILE4 -f SHUF"
+arg="h5repack_layout.h5 -f SHUF"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
@@ -416,7 +482,7 @@ else
fi
# fletcher32 with individual object
-arg="$FILE4 -f dset2:FLET -l dset2:CHUNK=20x10"
+arg="h5repack_layout.h5 -f dset2:FLET -l dset2:CHUNK=20x10"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
@@ -424,7 +490,7 @@ else
fi
# fletcher32 for all
-arg="$FILE4 -f FLET"
+arg="h5repack_layout.h5 -f FLET"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
@@ -432,7 +498,7 @@ else
fi
# all filters
-arg="$FILE4 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10"
+arg="h5repack_layout.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -440,7 +506,7 @@ else
fi
# verbose gzip with individual object
-arg="$FILE11 -v -f /dset_deflate:GZIP=9"
+arg="h5repack_filters.h5 -v -f /dset_deflate:GZIP=9"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -452,7 +518,7 @@ fi
###########################################################
# szip copy
-arg="$FILE7"
+arg="h5repack_szip.h5"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
@@ -460,7 +526,7 @@ else
fi
# szip remove
-arg="$FILE7 --filter=dset_szip:NONE"
+arg="h5repack_szip.h5 --filter=dset_szip:NONE"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
@@ -468,7 +534,7 @@ else
fi
# deflate copy
-arg="$FILE8"
+arg="h5repack_deflate.h5"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -476,7 +542,7 @@ else
fi
# deflate remove
-arg="$FILE8 -f dset_deflate:NONE"
+arg="h5repack_deflate.h5 -f dset_deflate:NONE"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -484,7 +550,7 @@ else
fi
# shuffle copy
-arg="$FILE9"
+arg="h5repack_shuffle.h5"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
@@ -492,7 +558,7 @@ else
fi
# shuffle remove
-arg="$FILE9 -f dset_shuffle:NONE"
+arg="h5repack_shuffle.h5 -f dset_shuffle:NONE"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
@@ -500,7 +566,7 @@ else
fi
# fletcher32 copy
-arg="$FILE10"
+arg="h5repack_fletcher.h5"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
@@ -508,7 +574,7 @@ else
fi
# fletcher32 remove
-arg="$FILE10 -f dset_fletcher32:NONE"
+arg="h5repack_fletcher.h5 -f dset_fletcher32:NONE"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
@@ -516,7 +582,7 @@ else
fi
# nbit copy
-arg="$FILE12"
+arg="h5repack_nbit.h5"
if test $USE_FILTER_NBIT != "yes" ; then
SKIP $arg
else
@@ -524,7 +590,7 @@ else
fi
# nbit remove
-arg="$FILE12 -f dset_nbit:NONE"
+arg="h5repack_nbit.h5 -f dset_nbit:NONE"
if test $USE_FILTER_NBIT != "yes" ; then
SKIP $arg
else
@@ -532,7 +598,7 @@ else
fi
# nbit add
-arg="$FILE12 -f dset_int31:NBIT"
+arg="h5repack_nbit.h5 -f dset_int31:NBIT"
if test $USE_FILTER_NBIT != "yes" ; then
SKIP $arg
else
@@ -540,7 +606,7 @@ else
fi
# scaleoffset copy
-arg="$FILE13"
+arg="h5repack_soffset.h5"
if test $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
@@ -548,7 +614,7 @@ else
fi
# scaleoffset add
-arg="$FILE13 -f dset_none:SOFF=31,IN"
+arg="h5repack_soffset.h5 -f dset_none:SOFF=31,IN"
if test $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
@@ -556,7 +622,7 @@ else
fi
# scaleoffset remove
-arg="$FILE13 -f dset_scaleoffset:NONE"
+arg="h5repack_soffset.h5 -f dset_scaleoffset:NONE"
if test $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
@@ -564,7 +630,7 @@ else
fi
# remove all filters
-arg="$FILE11 -f NONE"
+arg="h5repack_filters.h5 -f NONE"
if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
@@ -573,14 +639,14 @@ fi
#filter conversions
-arg="$FILE8 -f dset_deflate:SZIP=8,NN"
+arg="h5repack_deflate.h5 -f dset_deflate:SZIP=8,NN"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
TOOLTEST $arg
fi
-arg="$FILE7 -f dset_szip:GZIP=1"
+arg="h5repack_szip.h5 -f dset_szip:GZIP=1"
if test $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -589,7 +655,7 @@ fi
#limit
-arg="$FILE4 -f GZIP=1 -m 1024"
+arg="h5repack_layout.h5 -f GZIP=1 -m 1024"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -597,7 +663,7 @@ else
fi
#file
-arg="$FILE4 -e $srcdir/$INFO_FILE"
+arg="h5repack_layout.h5 -e $TESTDIR/h5repack.info"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -607,90 +673,90 @@ fi
#########################################################
# layout options (these files have no filters)
#########################################################
-TOOLTEST_MAIN $FILE4 --layout dset2:CHUNK=20x10
-VERIFY_LAYOUT_DSET $FILE4 dset2 CHUNKED
+TOOLTEST_MAIN h5repack_layout.h5 --layout dset2:CHUNK=20x10
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CHUNKED
-TOOLTEST_MAIN $FILE4 -l CHUNK=20x10
-VERIFY_LAYOUT_ALL $FILE4 CHUNKED
+TOOLTEST_MAIN h5repack_layout.h5 -l CHUNK=20x10
+VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED
-TOOLTEST_MAIN $FILE4 -l dset2:CONTI
-VERIFY_LAYOUT_DSET $FILE4 dset2 CONTIGUOUS
+TOOLTEST_MAIN h5repack_layout.h5 -l dset2:CONTI
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CONTIGUOUS
-TOOLTEST_MAIN $FILE4 -l CONTI
-VERIFY_LAYOUT_ALL $FILE4 CONTIGUOUS
+TOOLTEST_MAIN h5repack_layout.h5 -l CONTI
+VERIFY_LAYOUT_ALL h5repack_layout.h5 CONTIGUOUS
-TOOLTEST_MAIN $FILE4 -l dset2:COMPA
-VERIFY_LAYOUT_DSET $FILE4 dset2 COMPACT
+TOOLTEST_MAIN h5repack_layout.h5 -l dset2:COMPA
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 COMPACT
-TOOLTEST_MAIN $FILE4 -l COMPA
-VERIFY_LAYOUT_ALL $FILE4 COMPACT
+TOOLTEST_MAIN h5repack_layout.h5 -l COMPA
+VERIFY_LAYOUT_ALL h5repack_layout.h5 COMPACT
################################################################
# layout conversions (file has no filters)
###############################################################
-TOOLTEST_MAIN $FILE4 -l dset_compact:CONTI
-VERIFY_LAYOUT_DSET $FILE4 dset_compact CONTIGUOUS
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CONTI
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CONTIGUOUS
-TOOLTEST_MAIN $FILE4 -l dset_compact:CHUNK=2x5
-VERIFY_LAYOUT_DSET $FILE4 dset_compact CHUNKED
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CHUNK=2x5
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CHUNKED
-TOOLTEST_MAIN $FILE4 -l dset_compact:COMPA
-VERIFY_LAYOUT_DSET $FILE4 dset_compact COMPACT
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:COMPA
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact COMPACT
-TOOLTEST_MAIN $FILE4 -l dset_contiguous:COMPA
-VERIFY_LAYOUT_DSET $FILE4 dset_contiguous COMPACT
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:COMPA
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous COMPACT
-TOOLTEST_MAIN $FILE4 -l dset_contiguous:CHUNK=3x6
-VERIFY_LAYOUT_DSET $FILE4 dset_contiguous CHUNKED
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CHUNK=3x6
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CHUNKED
-TOOLTEST_MAIN $FILE4 -l dset_contiguous:CONTI
-VERIFY_LAYOUT_DSET $FILE4 dset_contiguous CONTIGUOUS
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CONTI
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CONTIGUOUS
-TOOLTEST_MAIN $FILE4 -l dset_chunk:COMPA
-VERIFY_LAYOUT_DSET $FILE4 dset_chunk COMPACT
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:COMPA
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk COMPACT
-TOOLTEST_MAIN $FILE4 -l dset_chunk:CONTI
-VERIFY_LAYOUT_DSET $FILE4 dset_chunk CONTIGUOUS
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CONTI
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CONTIGUOUS
-TOOLTEST_MAIN $FILE4 -l dset_chunk:CHUNK=18x13
-VERIFY_LAYOUT_DSET $FILE4 dset_chunk CHUNKED
+TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CHUNK=18x13
+VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CHUNKED
# test convert small size dataset ( < 1k) to compact layout without -m
-TOOLTEST_MAIN $FILE18 -l contig_small:COMPA
-VERIFY_LAYOUT_DSET $FILE18 contig_small COMPACT
+TOOLTEST_MAIN h5repack_layout2.h5 -l contig_small:COMPA
+VERIFY_LAYOUT_DSET h5repack_layout2.h5 contig_small COMPACT
-TOOLTEST_MAIN $FILE18 -l chunked_small_fixed:COMPA
-VERIFY_LAYOUT_DSET $FILE18 chunked_small_fixed COMPACT
+TOOLTEST_MAIN h5repack_layout2.h5 -l chunked_small_fixed:COMPA
+VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT
# Native option
# Do not use FILE1, as the named dtype will be converted to native, and h5diff will
# report a difference.
-TOOLTEST $FILE0 -n
-TOOLTEST $FILE2 -n
+TOOLTEST h5repack_fill.h5 -n
+TOOLTEST h5repack_attr.h5 -n
# latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters)
-arg="$FILE4 --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]"
+arg="h5repack_layout.h5 --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
TOOLTEST_MAIN $arg
- VERIFY_LAYOUT_ALL $FILE4 CHUNKED
+ VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED
fi
# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters)
-arg="$FILE4 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]"
+arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
TOOLTEST_MAIN $arg
- VERIFY_LAYOUT_ALL $FILE4 CHUNKED
+ VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED
fi
# several global filters
-arg="$FILE4 --filter GZIP=1 --filter SHUF"
+arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF"
if test $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
@@ -699,7 +765,7 @@ fi
# syntax of -i infile -o outfile
# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters)
-arg="$FILE4 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]"
+arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -707,34 +773,34 @@ else
fi
# add a userblock to file
-arg="$FILE1 -u ublock.bin -b 2048"
+arg="h5repack_objs.h5 -u ublock.bin -b 2048"
TOOLTEST $arg
# add alignment
-arg="$FILE1 -t 1 -a 1 "
+arg="h5repack_objs.h5 -t 1 -a 1 "
TOOLTEST $arg
# Check repacking file with old version of layout message (should get upgraded
# to new version and be readable, etc.)
-TOOLTEST $FILE14
+TOOLTEST h5repack_layouto.h5
# test for datum size > H5TOOLS_MALLOCSIZE
-TOOLTEST $FILE1 -f GZIP=1
+TOOLTEST h5repack_objs.h5 -f GZIP=1
# Check repacking file with committed datatypes in odd configurations
-TOOLTEST $FILE15
+TOOLTEST h5repack_named_dtypes.h5
# tests family driver (file is located in common testfiles folder, uses TOOLTEST1
-TOOLTEST1 $FILE16
+TOOLTEST1 tfamily%05d.h5
# test various references (bug 1814 and 1726)
-TOOLTEST $FILE_REF
+TOOLTEST h5repack_refs.h5
# test attribute with various references (bug 1797)
# the references in attribute of compund or vlen datatype
# TODO: include this test when code portion is completed.
-SKIP $FILE_ATTR_REF
-#TOOLTEST $FILE_ATTR_REF
+SKIP h5repack_attr_refs.h5
+#TOOLTEST h5repack_attr_refs.h5
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in
index 0d30b26..c5cb3e8 100644
--- a/tools/h5stat/testh5stat.sh.in
+++ b/tools/h5stat/testh5stat.sh.in
@@ -32,6 +32,7 @@ STAT_BIN=`pwd`/$STAT # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
+CP='cp'
nerrors=0
verbose=yes
@@ -41,7 +42,79 @@ if test -z "$srcdir"; then
srcdir=.
fi
-test -d ./testfiles || mkdir ./testfiles
+# 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"
+
+TESTDIR=./testfiles
+test -d $TESTDIR || mkdir $TESTDIR
+
+######################################################################
+# 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_HDF5_TEST_FILES="
+$SRC_H5STAT_TESTFILES/h5stat_filters.h5
+$SRC_H5STAT_TESTFILES/h5stat_tsohm.h5
+$SRC_H5STAT_TESTFILES/h5stat_newgrat.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5STAT_TESTFILES/h5stat_help1.ddl
+$SRC_H5STAT_TESTFILES/h5stat_help2.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-file.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-F.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-d.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-g.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-dT.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-UD.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-UT.ddl
+$SRC_H5STAT_TESTFILES/h5stat_tsohm.ddl
+$SRC_H5STAT_TESTFILES/h5stat_newgrat.ddl
+$SRC_H5STAT_TESTFILES/h5stat_newgrat-UG.ddl
+$SRC_H5STAT_TESTFILES/h5stat_newgrat-UA.ddl
+"
+
+#
+# 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 line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
@@ -60,9 +133,9 @@ TESTING() {
# non-zero value.
#
TOOLTEST() {
- expect="$srcdir/testfiles/$1"
- actual="./testfiles/`basename $1 .ddl`.out"
- actual_err="./testfiles/`basename $1 .ddl`.err"
+ expect="$TESTDIR/$1"
+ actual="$TESTDIR/`basename $1 .ddl`.out"
+ actual_err="$TESTDIR/`basename $1 .ddl`.err"
shift
# Run test.
@@ -71,7 +144,7 @@ TOOLTEST() {
echo "#############################"
echo "Expected output for '$STAT $@'"
echo "#############################"
- cd $srcdir/testfiles
+ cd $TESTDIR
$RUNSERIAL $STAT_BIN $@
) >$actual 2>$actual_err
cat $actual_err >> $actual
@@ -110,6 +183,8 @@ SKIP() {
### T H E T E S T S ###
##############################################################################
##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
# Test for help flag
TOOLTEST h5stat_help1.ddl -h