From 21d69ca15f004063c8784efeab84ebb1eb3e8033 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 8 Oct 2019 23:26:03 -0500 Subject: Fix errors in testh5dump.sh tests that grep for reference error messages. --- tools/test/h5dump/testh5dump.sh.in | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 8b6118e..c9f71a9 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -935,6 +935,36 @@ GREPTEST() fi } +# Call the h5dump tool and grep for an error string +# +GREPERRTEST() +{ + expectdata=$1 + actual=$TESTDIR/$2 + actual_err="$TESTDIR/`basename $2 .ddl`.oerr" + shift + shift + + # Run test. + TESTING $DUMPER -p $@ + ( + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" + ) >$actual 2>$actual_err + $GREP "$expectdata" $actual_err > /dev/null + if [ $? -eq 0 ]; then + echo " PASSED" + else + echo " FAILED" + nerrors="`expr $nerrors + 1`" + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err + fi +} + # Print a "SKIP" message SKIP() { TESTING $DUMPER $@ @@ -1137,7 +1167,7 @@ TOOLTEST tvlenstr_array.ddl --enable-error-stack tvlenstr_array.h5 # test for files with array data TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5 # # added for bug# 2092 - tarray1_big.h -GREPTEST "Undefined reference pointer" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 +GREPERRTEST "unable to get object address" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5 TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5 TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5 @@ -1345,9 +1375,9 @@ fi # test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 -GREPTEST "Undefined reference pointer" tdataregR.ddl --enable-error-stack -R tdatareg.h5 +GREPERRTEST "unable to get object address" tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 -GREPTEST "Undefined reference pointer" tattrregR.ddl --enable-error-stack -R tattrreg.h5 +GREPERRTEST "unable to get object address" tattrregR.ddl --enable-error-stack -R tattrreg.h5 TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 # Clean up text output files -- cgit v0.12 From d1f330fd61a741543e0c6325b83818aa7713a51a Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 9 Oct 2019 09:36:26 -0500 Subject: Corrections and improvements to testh5dump.sh.in changes. --- tools/test/h5dump/testh5dump.sh.in | 44 +++++++++----------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index c9f71a9..485265c 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -906,12 +906,14 @@ TOOLTEST_HELP() { } # Call the h5dump tool and grep for a value -# +# "value" mode greps test output, otherwise test error output GREPTEST() { expectdata=$1 actual=$TESTDIR/$2 actual_err="$TESTDIR/`basename $2 .ddl`.oerr" + mode=$3 + shift shift shift @@ -921,37 +923,11 @@ GREPTEST() cd $TESTDIR $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err - $GREP $expectdata $actual > /dev/null - if [ $? -eq 0 ]; then - echo " PASSED" + if [[ "$mode" = "value" ]]; then + $GREP $expectdata $actual > /dev/null else - echo " FAILED" - nerrors="`expr $nerrors + 1`" - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + $GREP "$expectdata" $actual_err > /dev/null fi -} - -# Call the h5dump tool and grep for an error string -# -GREPERRTEST() -{ - expectdata=$1 - actual=$TESTDIR/$2 - actual_err="$TESTDIR/`basename $2 .ddl`.oerr" - shift - shift - - # Run test. - TESTING $DUMPER -p $@ - ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" - ) >$actual 2>$actual_err - $GREP "$expectdata" $actual_err > /dev/null if [ $? -eq 0 ]; then echo " PASSED" else @@ -1167,7 +1143,7 @@ TOOLTEST tvlenstr_array.ddl --enable-error-stack tvlenstr_array.h5 # test for files with array data TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5 # # added for bug# 2092 - tarray1_big.h -GREPERRTEST "unable to get object address" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 +GREPTEST "Undefined reference pointer" tarray1_big.ddl errtxt --enable-error-stack -R tarray1_big.h5 TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5 TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5 TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5 @@ -1375,9 +1351,9 @@ fi # test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 -GREPERRTEST "unable to get object address" tdataregR.ddl --enable-error-stack -R tdatareg.h5 +GREPTEST "Undefined reference pointer" tdataregR.ddl errtxt --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 -GREPERRTEST "unable to get object address" tattrregR.ddl --enable-error-stack -R tattrreg.h5 +GREPTEST "Undefined reference pointer" tattrregR.ddl errtxt --enable-error-stack -R tattrreg.h5 TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 # Clean up text output files @@ -1426,7 +1402,7 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5 TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5 # test to verify HDFFV-9407: long double full precision -GREPTEST "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5 +GREPTEST "1.123456789012345" t128bit_float.ddl value -m %.35Lf t128bit_float.h5 # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR -- cgit v0.12 From 78268762bcf9cb949f711fa0e5290f96957cb60a Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 9 Oct 2019 11:04:15 -0500 Subject: Improvements in response to Allen's suggestions. --- tools/test/h5dump/testh5dump.sh.in | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 485265c..141715c 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -906,13 +906,13 @@ TOOLTEST_HELP() { } # Call the h5dump tool and grep for a value -# "value" mode greps test output, otherwise test error output +# txttype ERRTXT greps test error output, otherwise greps test output GREPTEST() { - expectdata=$1 - actual=$TESTDIR/$2 - actual_err="$TESTDIR/`basename $2 .ddl`.oerr" - mode=$3 + txttype=$1 + expectdata=$2 + actual=$TESTDIR/$3 + actual_err="$TESTDIR/`basename $3 .ddl`.oerr" shift shift shift @@ -923,10 +923,10 @@ GREPTEST() cd $TESTDIR $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err - if [[ "$mode" = "value" ]]; then - $GREP $expectdata $actual > /dev/null - else + if [[ "$txttype" = "ERRTXT" ]]; then $GREP "$expectdata" $actual_err > /dev/null + else + $GREP "$expectdata" $actual > /dev/null fi if [ $? -eq 0 ]; then echo " PASSED" @@ -1143,7 +1143,7 @@ TOOLTEST tvlenstr_array.ddl --enable-error-stack tvlenstr_array.h5 # test for files with array data TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5 # # added for bug# 2092 - tarray1_big.h -GREPTEST "Undefined reference pointer" tarray1_big.ddl errtxt --enable-error-stack -R tarray1_big.h5 +GREPTEST ERRTXT "Undefined reference pointer" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5 TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5 TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5 @@ -1351,9 +1351,9 @@ fi # test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 -GREPTEST "Undefined reference pointer" tdataregR.ddl errtxt --enable-error-stack -R tdatareg.h5 +GREPTEST ERRTXT "Undefined reference pointer" tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 -GREPTEST "Undefined reference pointer" tattrregR.ddl errtxt --enable-error-stack -R tattrreg.h5 +GREPTEST ERRTXT "Undefined reference pointer" tattrregR.ddl --enable-error-stack -R tattrreg.h5 TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 # Clean up text output files @@ -1402,7 +1402,7 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5 TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5 # test to verify HDFFV-9407: long double full precision -GREPTEST "1.123456789012345" t128bit_float.ddl value -m %.35Lf t128bit_float.h5 +GREPTEST OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5 # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR -- cgit v0.12