HDFFV-10632 update autotools test scripts to match cmake
This commit is contained 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
|
||||
|
||||
Reference in New Issue
Block a user