From 59bb6d185e4e8afd65af4f33dec5c13627c9f8b7 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 29 Mar 2013 15:22:40 -0500 Subject: [svn-r23492] Bug fix: Test was not checking error result. It basically return succeess to make check all the time. Fixed it so that it does check the return code of the test (plugin) and set nerror accordingly. It then exit 1 if there is any error detected. Test: use the desy committest to pass on jam, koala, ostrich, duck and emu. Also hand test by "rm test/.lib/libdynlib1* to verify the test script can indeed response to errors properly. --- test/test_plugin.sh.in | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index f2f3a1a..630a689 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -34,9 +34,6 @@ TEST_NAME=plugin TEST_BIN=`pwd`/$TEST_NAME ENVCMD="env HDF5_PLUGIN_PATH=`pwd`/.libs" -# Run the test -$ENVCMD $TEST_BIN - # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". # @@ -45,8 +42,18 @@ TESTING() { echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' } -if test $nerrors -eq 0 ; then - echo "All Plugin API tests passed." +# Main Body +# Run the test +$ENVCMD $TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` fi -exit $nerrors +# print results +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit 1 +else + echo "All Plugin API tests passed." + exit 0 +fi -- cgit v0.12