diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-05-04 16:38:08 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-05-04 16:38:08 (GMT) |
commit | 2f1b5170210bf076b2338fff658132ace53d157e (patch) | |
tree | 25750d9c2a41cef70db7bee31e71fda97476a6a3 /tools/h5repack/h5repack.sh.in | |
parent | f962c3d963b16a37170f9173070b8a04b7b939e0 (diff) | |
download | hdf5-2f1b5170210bf076b2338fff658132ace53d157e.zip hdf5-2f1b5170210bf076b2338fff658132ace53d157e.tar.gz hdf5-2f1b5170210bf076b2338fff658132ace53d157e.tar.bz2 |
[svn-r29884] VDS correction for get_space_status, with test change.
Add new files for repack tests.
Add repack tests for VDS files.
Diffstat (limited to 'tools/h5repack/h5repack.sh.in')
-rw-r--r-- | tools/h5repack/h5repack.sh.in | 155 |
1 files changed, 111 insertions, 44 deletions
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 74da4c0..c2f0459 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -147,9 +147,15 @@ $SRC_H5REPACK_TESTFILES/ublock.bin $SRC_H5REPACK_TESTFILES/h5repack.info $SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl $SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl -$SRC_H5REPACK_TESTFILES/h5repack_filters.h5.tst +$SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst +$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst $SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl $SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst +$SRC_H5REPACK_TESTFILES/1_vds.h5-vds_dset_chunk20x10x5-v.ddl +$SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl +$SRC_H5REPACK_TESTFILES/3_1_vds.h5-vds_chunk2x5x8-v.ddl +$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_compa-v.ddl +$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl " # @@ -173,7 +179,7 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." @@ -190,7 +196,7 @@ CLEAN_TESTFILES_AND_TESTDIR() # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail - SDIR=`$DIRNAME $SRC_H5REPACK_TESTFILES/h5repack-help.txt` + SDIR=$SRC_H5REPACK_TESTFILES INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then @@ -535,11 +541,11 @@ TOOLTEST1() ) RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi rm -f $outfile } @@ -549,7 +555,7 @@ TOOLTEST1() # TOOLTESTV() { - expect="$TESTDIR/$2.tst" + expect="$TESTDIR/$2-$1.tst" actual="$TESTDIR/`basename $2 .ddl`.out" actual_err="$TESTDIR/`basename $2 .ddl`.err" @@ -566,11 +572,11 @@ TOOLTESTV() ) >$actual 2>$actual_err RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi # display output compare @@ -591,6 +597,62 @@ TOOLTESTV() rm -f $outfile } +# same as TOOLTESTV but filters error stack output and compares to an error file +# Extract file name, line number, version and thread IDs because they may be different +# ADD_H5ERR_MASK_TEST +TOOLTESTM() { + + expect="$TESTDIR/$2-$1.tst" + actual="$TESTDIR/`basename $2 .tst`.out" + actual_err="$TESTDIR/`basename $2 .tst`.oerr" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + + infile=$2 + outfile=out-$1.$2 + shift + shift + + # Run test. + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + cp $actual_err $actual_err_sav + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.tst) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi + +} + # This is same as TOOLTESTV() with comparing h5dump output # from -pH option # @@ -700,16 +762,17 @@ TOOLTEST_META() # verify sizes. MESSAGE "Verify the sizes of both output files ($size1 vs $size2)" if [ $size1 -lt $size2 ]; then - # pass - echo " PASSED" + # pass + echo " PASSED" else - #fail - echo "*FAILED*" + #fail + echo "*FAILED*" nerrors="`expr $nerrors + 1`" fi rm -f $outfile } + # ADD_HELP_TEST TOOLTEST_HELP() { @@ -777,7 +840,7 @@ USE_FILTER_SZIP_ENCODER=`$RUNSERIAL $H5DETECTSZIP_BIN` fi ############################################################################## -### T H E T E S T S +### T H E T E S T S ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR @@ -999,6 +1062,8 @@ VERIFY_LAYOUT_DSET dset2_compa h5repack_layout.h5 dset2 COMPACT -l dset2:COMPA VERIFY_LAYOUT_ALL compa h5repack_layout.h5 COMPACT -l COMPA +TOOLTESTM dset2_chunk_20x10-errstk h5repack_layout.h5 --layout=dset2:CHUNK=20x10x5 --enable-error-stack + ################################################################ # layout conversions (file has no filters) ############################################################### @@ -1154,36 +1219,38 @@ TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 # VDS tests -######################################################### -# layout options -######################################################### -# skip tests because of HDFFV-9756 -#VERIFY_LAYOUT_VDS vds_dset_conti 1_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI -#VERIFY_LAYOUT_ALL vds_null_conti 2_vds.h5 CONTIGUOUS -l CONTI -# skip test because of HDFFV-9756 -#VERIFY_LAYOUT_VDS vds_dset_compa 1_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -#VERIFY_LAYOUT_ALL vds_null_compa 2_vds.h5 COMPACT -l COMPA -SKIP vds_dset_conti 1_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI -SKIP vds_null_conti 2_vds.h5 CONTIGUOUS -l CONTI -SKIP vds_dset_compa 1_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -SKIP vds_null_compa 2_vds.h5 COMPACT -l COMPA - ################################################################ # layout conversions ############################################################### -# skip tests because of HDFFV-9756 -#VERIFY_LAYOUT_VDS vds_compa_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI -#VERIFY_LAYOUT_VDS vds_compa_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -#VERIFY_LAYOUT_VDS vds_conti_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -#VERIFY_LAYOUT_VDS vds_conti_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI -#VERIFY_LAYOUT_VDS vds_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -#VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI -SKIP vds_compa_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI -SKIP vds_compa_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -SKIP vds_conti_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -SKIP vds_conti_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI -SKIP vds_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA -SKIP vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI +if test $USE_FILTER_DEFLATE != "yes" ; then + SKIP vds_dset_chunk_20x10x5 +else + VERIFY_LAYOUT_VDS vds_dset_chunk_20x10x5 1_vds.h5 vds_dset CHUNKED --layout vds_dset:CHUNK=20x10x5 +fi + +if test $USE_FILTER_DEFLATE != "yes" ; then + SKIP vds_chunk2x5x8 +else + VERIFY_LAYOUT_VDS vds_chunk2x5x8 3_1_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=2x5x8 +fi + +if test $USE_FILTER_DEFLATE != "yes" ; then + SKIP vds_chunk3x6x9 +else + VERIFY_LAYOUT_VDS vds_chunk3x6x9 2_vds.h5 vds_dset CHUNKED -l vds_dset:CHUNK=3x6x9 +fi + +if test $USE_FILTER_DEFLATE != "yes" ; then + SKIP vds_compa 4_vds.h5 +else + VERIFY_LAYOUT_VDS vds_compa 4_vds.h5 vds_dset COMPACT -l vds_dset:COMPA +fi + +if test $USE_FILTER_DEFLATE != "yes" ; then + SKIP vds_conti 4_vds.h5 +else + VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI +fi # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR |