diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2011-05-07 17:06:48 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2011-05-07 17:06:48 (GMT) |
commit | bcde54c0031d29a56bea731303e0bd10d37b8bd7 (patch) | |
tree | 4eff4df18acd1ccc6fa569eb0dd1a2e598fa700e /tools/h5copy | |
parent | 88a54b790d4c3fcf96161f97192be7bad44cf156 (diff) | |
download | hdf5-bcde54c0031d29a56bea731303e0bd10d37b8bd7.zip hdf5-bcde54c0031d29a56bea731303e0bd10d37b8bd7.tar.gz hdf5-bcde54c0031d29a56bea731303e0bd10d37b8bd7.tar.bz2 |
[svn-r20772] Problem:
Test scripts sometimes need to filter some system-specific messages from the
actual output so that it can match the correct expected output. These filtering
functions, ususally called "STDOUT_FILTER()" and "STDERR_FILTER()" were being
repeated in individual test scripts. This becomes a maintenance problem and
is error prone.
Solution:
Extract the two filter functions code to bin/output_filter.sh and then each
test script sources it in. This allows reuse of coding and is much easier to
maintain and to add new filtering.
Tested:
LLNL Zeus (linux64 cluster) and Dawndev (Blue-Gene cluster), both for serial
mode only.
Diffstat (limited to 'tools/h5copy')
-rw-r--r-- | tools/h5copy/testh5copy.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index 3f28559..1dbb03c 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -100,6 +100,9 @@ VERIFY_OUTPUT() echo "Verifying output files $* $SPACES" | cut -c1-70 | tr -d '\012' } +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + # Run a test and print PASS or *FAIL*. If h5copy can complete # with exit status 0, consider it pass. If a test fails then increment # the `nerrors' global variable. @@ -184,6 +187,8 @@ TOOLTEST_FAIL() expectout="$INDIR/$1" actualout="$OUTDIR/$1.out" actualerr="$OUTDIR/$1.err" + actualout_sav=${actualout}-sav + actualerr_sav=${actualerr}-sav shift if [ "$1" = -i ]; then inputfile=$2 @@ -199,7 +204,13 @@ TOOLTEST_FAIL() #echo "#############################" $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr + RET=$? + # save actualout and actualerr in case they are needed later. + cp $actualout $actualout_sav + STDOUT_FILTER $actualout + cp $actualerr $actualerr_sav + STDERR_FILTER $actualerr if [ $RET != 0 ]; then echo " PASSED" # Verifying output text from h5copy @@ -219,7 +230,7 @@ TOOLTEST_FAIL() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr + rm -f $actualout $actualerr $actualout_sav $actualerr_sav fi } |