summaryrefslogtreecommitdiffstats
path: root/tools/test/h5diff
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-05-03 19:54:30 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-05-03 19:54:30 (GMT)
commited31eeacfadb6b0c07e2b46d4c16bcbc1747d2e1 (patch)
tree190433c1113b330aeda39b2505c32070e9a5550a /tools/test/h5diff
parenta58881550d74626a38c127bff4a7f6a1be03474d (diff)
downloadhdf5-ed31eeacfadb6b0c07e2b46d4c16bcbc1747d2e1.zip
hdf5-ed31eeacfadb6b0c07e2b46d4c16bcbc1747d2e1.tar.gz
hdf5-ed31eeacfadb6b0c07e2b46d4c16bcbc1747d2e1.tar.bz2
Many small changes from develop. Should allows running VFD SWMR
tests from CMake.
Diffstat (limited to 'tools/test/h5diff')
-rw-r--r--tools/test/h5diff/h5diff_plugin.sh.in117
-rw-r--r--tools/test/h5diff/testh5diff.sh.in48
2 files changed, 90 insertions, 75 deletions
diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in
index ff3d289..0ab169a 100644
--- a/tools/test/h5diff/h5diff_plugin.sh.in
+++ b/tools/test/h5diff/h5diff_plugin.sh.in
@@ -135,24 +135,24 @@ CLEAN_TESTFILES_AND_TESTDIR()
# -h print help page
while [ $# -gt 0 ]; do
case "$1" in
- -p) # reset the tool name and bin to run ph5diff tests
- TESTNAME=ph5diff
- H5DIFF=../../src/h5diff/ph5diff # The tool name
- H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary
- pmode=yes
- shift
- ;;
+ -p) # reset the tool name and bin to run ph5diff tests
+ TESTNAME=ph5diff
+ H5DIFF=../../src/h5diff/ph5diff # The tool name
+ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary
+ pmode=yes
+ shift
+ ;;
-h) # print help page
- echo "$0 [-p] [-h]"
- echo " -p run ph5diff tests"
- echo " -h print help page"
- shift
- exit 0
- ;;
+ echo "$0 [-p] [-h]"
+ echo " -p run ph5diff tests"
+ echo " -h print help page"
+ shift
+ exit 0
+ ;;
*) # unknown option
echo "$0: Unknown option ($1)"
- exit 1
- ;;
+ exit 1
+ ;;
esac
done
@@ -218,19 +218,21 @@ TOOLTEST() {
# Run test.
TESTING $H5DIFF $@
(
- #echo "#############################"
- #echo "Expected output for '$H5DIFF $@'"
- #echo "#############################"
- cd $TESTDIR
- eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@"
+ #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
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
@@ -260,27 +262,29 @@ TOOLTEST() {
actual_sorted=actual_sorted
sort $expect -o $expect_sorted
sort $actual -o $actual_sorted
+
# remove "EXIT CODE:" line from expect file. test for exit code
# is done by serial mode.
grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit
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 ""
+
+ 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
- fi
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
@@ -306,18 +310,20 @@ TOOLTEST_ERR() {
# Run test.
TESTING $H5DIFF $@
(
- #echo "#############################"
- #echo "Expected output for '$H5DIFF $@'"
- #echo "#############################"
- cd $TESTDIR
- eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@"
+ #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
@@ -348,23 +354,24 @@ TOOLTEST_ERR() {
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 ""
+
+ 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
- fi
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in
index ac02da2..c8f8ed2 100644
--- a/tools/test/h5diff/testh5diff.sh.in
+++ b/tools/test/h5diff/testh5diff.sh.in
@@ -500,18 +500,20 @@ TOOLTEST() {
# Run test.
TESTING $H5DIFF $@
(
- #echo "#############################"
- #echo "Expected output for '$H5DIFF $@'"
- #echo "#############################"
- cd $TESTDIR
- eval $RUNCMD $H5DIFF_BIN "$@"
+ #echo "#############################"
+ #echo "Expected output for '$H5DIFF $@'"
+ #echo "#############################"
+ cd $TESTDIR
+ eval $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
@@ -545,23 +547,24 @@ TOOLTEST() {
# is done by serial mode.
grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit
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 ""
+
+ 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
- fi
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
@@ -1199,6 +1202,11 @@ TOOLTEST h5diff_800.txt -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array /g1/array
TOOLTEST h5diff_801.txt -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array
# ##############################################################################
+# # dataset subsets
+# ##############################################################################
+#TRILABS_227 TOOLTEST h5diff_830.txt --enable-error-stack -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;]
+
+# ##############################################################################
# VDS tests
# ##############################################################################
TOOLTEST h5diff_v1.txt -v 1_vds.h5 2_vds.h5