summaryrefslogtreecommitdiffstats
path: root/tools/test/h5diff
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/h5diff
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/h5diff')
-rw-r--r--tools/test/h5diff/h5diff_plugin.sh.in87
-rw-r--r--tools/test/h5diff/testh5diff.sh.in6
2 files changed, 90 insertions, 3 deletions
diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in
index 212f5d6..341cba5 100644
--- a/tools/test/h5diff/h5diff_plugin.sh.in
+++ b/tools/test/h5diff/h5diff_plugin.sh.in
@@ -62,6 +62,7 @@ LIST_HDF5_TEST_FILES="
$SRC_H5DIFF_TESTFILES/tudfilter.h5
$SRC_H5DIFF_TESTFILES/tudfilter2.h5
$SRC_H5DIFF_TESTFILES/h5diff_ud.txt
+$SRC_H5DIFF_TESTFILES/h5diff_udfail.err
$SRC_H5DIFF_TESTFILES/h5diff_udfail.txt
"
@@ -204,7 +205,7 @@ VERIFY() {
TOOLTEST() {
expect="$TESTDIR/$1"
actual="$TESTDIR/`basename $1 .txt`.out"
- actual_err="$TESTDIR/`basename $1 .txt`.err"
+ actual_err="$TESTDIR/`basename $1 .txt`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -287,6 +288,90 @@ TOOLTEST() {
rm -f $actual_sorted $expect_sorted
fi
}
+# Same as TOOLSET except only err file checked
+TOOLTEST_ERR() {
+ expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .txt`.err"
+ actual="$TESTDIR/`basename $1 .txt`.out"
+ actual_err="$TESTDIR/`basename $1 .txt`.out.err"
+ actual_sav=${actual}-sav
+ actual_err_sav=${actual_err}-sav
+ shift
+ if test -n "$pmode"; then
+ RUNCMD=$RUNPARALLEL
+ else
+ RUNCMD=$RUNSERIAL
+ fi
+
+ # Run test.
+ TESTING $H5DIFF $@
+ (
+ #echo "#############################"
+ #echo "Expected output for '$H5DIFF $@'"
+ #echo "#############################"
+ cd $TESTDIR
+ eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@"
+ ) >$actual 2>$actual_err
+ EXIT_CODE=$?
+ # save actual and actual_err in case they are needed later.
+ cp $actual $actual_sav
+ STDOUT_FILTER $actual
+ cp $actual_err $actual_err_sav
+ STDERR_FILTER $actual_err
+ # don't add exit code check in pmode, as it causes failure. (exit code
+ # is from mpirun not tool)
+ # if any problem occurs relate to an exit code, it will be caught in
+ # serial mode, so the test is fullfilled.
+ if test $h5haveexitcode = 'yes' -a -z "$pmode"; then
+ echo "EXIT CODE: $EXIT_CODE" >> $actual
+ fi
+
+ 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`"
+ elif $CMP $expect_err $actual_err; then
+ echo " PASSED"
+ elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then
+ echo "*FAILED*"
+ echo " Expected result ($expect_err) differs from actual result ($actual_err)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect_err $actual_err |sed 's/^/ /'
+ else
+ # parallel mode output are often of different ordering from serial
+ # output. If the sorted expect_err and actual_err files compare the same,
+ # it is safe to assume the actual output match the expected file.
+ expect_sorted=expect_sorted
+ actual_sorted=actual_sorted
+ sort $expect_err -o $expect_sorted
+ sort $actual_err -o $actual_sorted
+ mv $expect_sorted.noexit $expect_sorted
+ if $CMP $expect_sorted $actual_sorted; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ if test yes = "$verbose"; then
+ echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)"
+ $DIFF $expect_sorted $actual_sorted |sed 's/^/ /'
+ echo "====The actual output ($actual_sav)"
+ sed 's/^/ /' < $actual_sav
+ echo "====The actual stderr ($actual_err_sav)"
+ sed 's/^/ /' < $actual_err_sav
+ echo "====End of actual stderr ($actual_err_sav)"
+ echo ""
+ fi
+ fi
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actual_err $actual_sav $actual_err_sav
+ rm -f $actual_sorted $expect_sorted
+ fi
+}
##############################################################################
### T H E T E S T S
diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in
index c464f94..557d2ff 100644
--- a/tools/test/h5diff/testh5diff.sh.in
+++ b/tools/test/h5diff/testh5diff.sh.in
@@ -226,6 +226,7 @@ $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/dangling_link.err
$SRC_H5DIFF_TESTFILES/h5diff_455.txt
$SRC_H5DIFF_TESTFILES/h5diff_456.txt
$SRC_H5DIFF_TESTFILES/h5diff_457.txt
@@ -286,6 +287,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_62.txt
$SRC_H5DIFF_TESTFILES/h5diff_63.txt
$SRC_H5DIFF_TESTFILES/h5diff_600.txt
$SRC_H5DIFF_TESTFILES/h5diff_601.txt
+$SRC_H5DIFF_TESTFILES/h5diff_601_ERR.err
$SRC_H5DIFF_TESTFILES/h5diff_603.txt
$SRC_H5DIFF_TESTFILES/h5diff_604.txt
$SRC_H5DIFF_TESTFILES/h5diff_605.txt
@@ -462,8 +464,9 @@ TESTING() {
#
TOOLTEST() {
expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .txt`.err"
actual="$TESTDIR/`basename $1 .txt`.out"
- actual_err="$TESTDIR/`basename $1 .txt`.err"
+ actual_err="$TESTDIR/`basename $1 .txt`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -488,7 +491,6 @@ TOOLTEST() {
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
- cat $actual_err >> $actual
# don't add exit code check in pmode, as it causes failure. (exit code
# is from mpirun not tool)
# if any problem occurs relate to an exit code, it will be caught in