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/misc | |
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/misc')
-rw-r--r-- | tools/misc/testh5mkgrp.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/misc/testh5mkgrp.sh b/tools/misc/testh5mkgrp.sh index 46264c2..7bb98cb 100644 --- a/tools/misc/testh5mkgrp.sh +++ b/tools/misc/testh5mkgrp.sh @@ -51,6 +51,9 @@ TESTING() echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' } +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # @@ -97,6 +100,7 @@ H5LSTEST() { expect="$INDIR/`basename $1 .h5`.ls" actual="$OUTDIR/`basename $1 .h5`.out" + actual_sav=${actual}-sav # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. @@ -108,6 +112,10 @@ H5LSTEST() $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual + # save actual in case it is needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + STDERR_FILTER $actual if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. @@ -124,7 +132,7 @@ H5LSTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_sav fi } |