From 9f35a8b04e58db92296d716449cd5f560c6c1a5d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 14 Mar 2012 13:36:21 -0500 Subject: [svn-r22068] HDFFV-7876: wildcard filenames The test scripts for cmake, on windows, and the h5ls shell script do not work properly. Tested: h5committest --- MANIFEST | 3 ++ tools/h5dump/testh5dump.sh.in | 9 +++++ tools/h5ls/testh5ls.sh.in | 41 ++++++++++--------- tools/testfiles/tmultifile.ddl | 42 ++++++++++++++++++++ tools/testfiles/tqmarkfile.ddl | 83 +++++++++++++++++++++++++++++++++++++++ tools/testfiles/tstarfile.ddl | 89 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 249 insertions(+), 18 deletions(-) create mode 100644 tools/testfiles/tmultifile.ddl create mode 100644 tools/testfiles/tqmarkfile.ddl create mode 100644 tools/testfiles/tstarfile.ddl diff --git a/MANIFEST b/MANIFEST index c5ba0af..91c4ce5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1408,6 +1408,9 @@ ./tools/testfiles/tmulti-o.h5 ./tools/testfiles/tmulti-r.h5 ./tools/testfiles/tmulti-s.h5 +./tools/testfiles/tmultifile.ddl +./tools/testfiles/tqmarkfile.ddl +./tools/testfiles/tstarfile.ddl ./tools/testfiles/tnbit.ddl ./tools/testfiles/tnestcomp-1.ddl ./tools/testfiles/tnestedcomp.h5 diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 63c81ed..ae28df6 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -50,6 +50,7 @@ if test -z "$srcdir"; then fi # source dirs SRC_TOOLS="$srcdir/../" + SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" # testfiles source dirs for tools SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" @@ -244,6 +245,9 @@ $SRC_H5DUMP_TESTFILES/tlarge_objname.ddl $SRC_H5DUMP_TESTFILES/tlonglinks.ddl $SRC_H5DUMP_TESTFILES/tloop-1.ddl $SRC_H5DUMP_TESTFILES/tmulti.ddl +$SRC_H5DUMP_TESTFILES/tmultifile.ddl +$SRC_H5DUMP_TESTFILES/tqmarkfile.ddl +$SRC_H5DUMP_TESTFILES/tstarfile.ddl $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl $SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl $SRC_H5DUMP_TESTFILES/tnbit.ddl @@ -794,6 +798,11 @@ TOOLTEST tarray6.ddl --enable-error-stack tarray6.h5 TOOLTEST tarray7.ddl --enable-error-stack tarray7.h5 TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5 +# test for wildcards in filename (does not work with cmake) +TOOLTEST3 tstarfile --enable-error-stack -H -d Dataset1 tarr*.h5 +TOOLTEST3 tqmarkfile --enable-error-stack -H -d Dataset1 tarray?.h5 +TOOLTEST tmultifile --enable-error-stack -H -d Dataset1 tarray[2-7].h5 + # test for files with empty data TOOLTEST tempty.ddl --enable-error-stack tempty.h5 diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index e2c204b..d36988b 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -25,13 +25,13 @@ 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 +NLINES=20 # Max. lines of output to display if test fails WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" nerrors=0 verbose=yes -h5haveexitcode=yes # default is yes +h5haveexitcode=yes # default is yes # The build (current) directory might be different than the source directory. if test -z "$srcdir"; then srcdir=. @@ -210,7 +210,7 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - cd $TESTDIR + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err @@ -222,37 +222,37 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # 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 differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + 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 + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -322,6 +322,11 @@ TOOLTEST tsoftlinks-nodangle-1.ls 1 -w80 --follow-symlinks --no-dangling-links t # when used file with no dangling links - expected exit code 0 TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thlink.h5 +# test for wildcards in filename (does not work with cmake) +# this h5ls test script does not pass the filename properly like the h5dump test script??? +#TOOLTEST tstarfile t*link.h5 +#TOOLTEST tqmarkfile t?link.h5 +#TOOLTEST tmultifile t[h,s]link.h5 # tests for hard links TOOLTEST thlink-1.ls 0 -w80 thlink.h5 diff --git a/tools/testfiles/tmultifile.ddl b/tools/testfiles/tmultifile.ddl new file mode 100644 index 0000000..cf94f2c --- /dev/null +++ b/tools/testfiles/tmultifile.ddl @@ -0,0 +1,42 @@ +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} diff --git a/tools/testfiles/tqmarkfile.ddl b/tools/testfiles/tqmarkfile.ddl new file mode 100644 index 0000000..e7771cb --- /dev/null +++ b/tools/testfiles/tqmarkfile.ddl @@ -0,0 +1,83 @@ +HDF5 "tarray1.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray8.h5" { +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "Dataset1" diff --git a/tools/testfiles/tstarfile.ddl b/tools/testfiles/tstarfile.ddl new file mode 100644 index 0000000..77b80e0 --- /dev/null +++ b/tools/testfiles/tstarfile.ddl @@ -0,0 +1,89 @@ +HDF5 "tarray1_big.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [1000] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 2000 ) / ( 2000 ) } +} +} +HDF5 "tarray1.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray8.h5" { +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "Dataset1" -- cgit v0.12