diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2011-05-07 17:05:56 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2011-05-07 17:05:56 (GMT) |
commit | e21992e08f55d5473677df7c4f4e83019375e39e (patch) | |
tree | 7ff1a740bced6e246628ab934716fc1a03122440 /tools/h5diff/testh5diff.sh | |
parent | 054ca47350a07361e61d668453f62a0c657da70d (diff) | |
download | hdf5-e21992e08f55d5473677df7c4f4e83019375e39e.zip hdf5-e21992e08f55d5473677df7c4f4e83019375e39e.tar.gz hdf5-e21992e08f55d5473677df7c4f4e83019375e39e.tar.bz2 |
[svn-r20771] 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.
--This line, and those below, will be ignored--
M tools/misc/testh5mkgrp.sh
M tools/h5dump/testh5dump.sh.in
M tools/h5diff/testh5diff.sh
M tools/h5copy/testh5copy.sh
M tools/h5ls/testh5ls.sh.in
M MANIFEST
A bin/output_filter.sh
Diffstat (limited to 'tools/h5diff/testh5diff.sh')
-rwxr-xr-x | tools/h5diff/testh5diff.sh | 76 |
1 files changed, 2 insertions, 74 deletions
diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 48dc6a9..7803022 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -143,80 +143,8 @@ TESTING() { echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' } -# Some systems will dump some messages to stdout for various reasons. -# Remove them from the stdout result file. -# $1 is the file name of the file to be filtered. -# Cases of filter needed: -# 1. Sandia Red-Storm -# yod always prints these two lines at the beginning. -# LibLustre: NAL NID: 0004a605 (5) -# Lustre: OBD class driver Build Version: 1, info@clusterfs.com -# 2. LANL Lambda -# mpijob mirun -np always add an extra line at the end like: -# P4 procgroup file is /users/acheng/.lsbatch/host10524.l82 -STDOUT_FILTER() { - result_file=$1 - tmp_file=/tmp/h5test_tmp_$$ - # Filter Sandia Red-Storm yod messages. - cp $result_file $tmp_file - sed -e '/^LibLustre:/d' -e '/^Lustre:/d' \ - < $tmp_file > $result_file - # Filter LANL Lambda mpirun message. - cp $result_file $tmp_file - sed -e '/^P4 procgroup file is/d' \ - < $tmp_file > $result_file - # cleanup - rm -f $tmp_file -} - -# Some systems will dump some messages to stderr for various reasons. -# Remove them from the stderr result file. -# $1 is the file name of the file to be filtered. -# Cases of filter needed: -# 1. MPE: -# In parallel mode and if MPE library is used, it prints the following -# two message lines whether the MPE tracing is used or not. -# Writing logfile. -# Finished writing logfile. -# 2. LANL MPI: -# The LANL MPI will print some messages like the following, -# LA-MPI: *** mpirun (1.5.10) -# LA-MPI: *** 3 process(es) on 2 host(s): 2*fln21 1*fln22 -# LA-MPI: *** libmpi (1.5.10) -# LA-MPI: *** Copyright 2001-2004, ACL, Los Alamos National Laboratory -# 3. h5diff debug output: -# Debug output all have prefix "h5diff debug: ". -# 4. AIX system prints messages like these when it is aborting: -# ERROR: 0031-300 Forcing all remote tasks to exit due to exit code 1 in task 0 -# ERROR: 0031-250 task 4: Terminated -# ERROR: 0031-250 task 3: Terminated -# ERROR: 0031-250 task 2: Terminated -# ERROR: 0031-250 task 1: Terminated - -STDERR_FILTER() { - result_file=$1 - tmp_file=/tmp/h5test_tmp_$$ - # Filter MPE messages - if test -n "$pmode"; then - cp $result_file $tmp_file - sed -e '/^Writing logfile./d' -e '/^Finished writing logfile./d' \ - < $tmp_file > $result_file - fi - # Filter LANL MPI messages - # and LLNL srun messages - # and AIX error messages - if test -n "$pmode"; then - cp $result_file $tmp_file - sed -e '/^LA-MPI:/d' -e '/^srun:/d' -e '/^ERROR:/d' \ - < $tmp_file > $result_file - fi - # Filter h5diff debug output - cp $result_file $tmp_file - sed -e '/^h5diff debug: /d' \ - < $tmp_file > $result_file - # clean up temporary files. - rm -f $tmp_file -} +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh # Run a test and print PASS or *FAIL*. If a test fails then increment # the `nerrors' global variable and (if $verbose is set) display the |