summaryrefslogtreecommitdiffstats
path: root/tools/test/h5stat
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-12-06 18:48:39 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-12-06 18:48:39 (GMT)
commit11b4c1f3afde1016de8c75e423054854bed62001 (patch)
treedfee509ed981b06530fe26ee67c56620fe963fbe /tools/test/h5stat
parent2998dbfc709f7746831e71dfb24145bd62f4f4bb (diff)
downloadhdf5-11b4c1f3afde1016de8c75e423054854bed62001.zip
hdf5-11b4c1f3afde1016de8c75e423054854bed62001.tar.gz
hdf5-11b4c1f3afde1016de8c75e423054854bed62001.tar.bz2
HDFFV-10632 update autotools test scripts to match cmake
Diffstat (limited to 'tools/test/h5stat')
-rw-r--r--tools/test/h5stat/testh5stat.sh.in36
1 files changed, 24 insertions, 12 deletions
diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in
index 0a5127f..69b856e 100644
--- a/tools/test/h5stat/testh5stat.sh.in
+++ b/tools/test/h5stat/testh5stat.sh.in
@@ -79,6 +79,18 @@ $SRC_H5STAT_TESTFILES/h5stat_idx.h5
$SRC_H5STAT_TESTFILES/h5stat_threshold.h5
"
+LIST_ERR_TEST_FILES="
+$SRC_H5STAT_TESTFILES/h5stat_err_refcount.err
+$SRC_H5STAT_TESTFILES/h5stat_err_old_layout.err
+$SRC_H5STAT_TESTFILES/h5stat_err_old_fill.err
+$SRC_H5STAT_TESTFILES/h5stat_err1_links.err
+$SRC_H5STAT_TESTFILES/h5stat_err1_dims.err
+$SRC_H5STAT_TESTFILES/h5stat_err1_numattrs.err
+$SRC_H5STAT_TESTFILES/h5stat_err2_numattrs.err
+$SRC_H5STAT_TESTFILES/h5stat_notexist.err
+$SRC_H5STAT_TESTFILES/h5stat_nofile.err
+"
+
LIST_OTHER_TEST_FILES="
$SRC_H5STAT_TESTFILES/h5stat_err_refcount.ddl
$SRC_H5STAT_TESTFILES/h5stat_err_old_layout.ddl
@@ -100,17 +112,13 @@ $SRC_H5STAT_TESTFILES/h5stat_newgrat.ddl
$SRC_H5STAT_TESTFILES/h5stat_newgrat-UG.ddl
$SRC_H5STAT_TESTFILES/h5stat_newgrat-UA.ddl
$SRC_H5STAT_TESTFILES/h5stat_idx.ddl
-$SRC_H5STAT_TESTFILES/h5stat_err1_links.ddl
$SRC_H5STAT_TESTFILES/h5stat_links1.ddl
$SRC_H5STAT_TESTFILES/h5stat_links2.ddl
$SRC_H5STAT_TESTFILES/h5stat_links3.ddl
$SRC_H5STAT_TESTFILES/h5stat_links4.ddl
$SRC_H5STAT_TESTFILES/h5stat_links5.ddl
-$SRC_H5STAT_TESTFILES/h5stat_err1_dims.ddl
$SRC_H5STAT_TESTFILES/h5stat_dims1.ddl
$SRC_H5STAT_TESTFILES/h5stat_dims2.ddl
-$SRC_H5STAT_TESTFILES/h5stat_err1_numattrs.ddl
-$SRC_H5STAT_TESTFILES/h5stat_err2_numattrs.ddl
$SRC_H5STAT_TESTFILES/h5stat_numattrs1.ddl
$SRC_H5STAT_TESTFILES/h5stat_numattrs2.ddl
$SRC_H5STAT_TESTFILES/h5stat_numattrs3.ddl
@@ -120,7 +128,7 @@ $SRC_H5STAT_TESTFILES/h5stat_numattrs4.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="$LIST_HDF5_TEST_FILES $LIST_ERR_TEST_FILES $LIST_OTHER_TEST_FILES"
COPY_TESTFILES_TO_TESTDIR()
{
@@ -184,8 +192,9 @@ TESTING() {
#
TOOLTEST() {
expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .ddl`.err"
actual="$TESTDIR/`basename $1 .ddl`.out"
- actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ actual_err="$TESTDIR/`basename $1 .ddl`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -202,14 +211,17 @@ TOOLTEST() {
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
- cat $actual_err >> $actual
if [ ! -f $expect ]; then
- # Create the expect file if it doesn't yet exist.
- echo " CREATED"
- cp $actual $expect
- echo " Expected result (*.ddl) missing"
- nerrors="`expr $nerrors + 1`"
+ # Compare error files if the expect file doesn't exist.
+ if $CMP $expect_err $actual_err; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.err) differs from actual result (*.out.err)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect_err $actual_err |sed 's/^/ /'
+ fi
elif $CMP $expect $actual; then
echo " PASSED"
else