From 0d41b14350829b8b48799ce494125eab0db96099 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 23 Jul 2009 03:27:31 -0500 Subject: [svn-r17225] Added code to detect the exit code of each of the writer and readers processes and set nerrors accordingly. It still has a bunch of debug statements which will be cleaned out in the next round. Tested: Jam. --- test/testswmr.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/testswmr.sh b/test/testswmr.sh index 445b82e..ef8ad78 100755 --- a/test/testswmr.sh +++ b/test/testswmr.sh @@ -56,19 +56,42 @@ TESTING() { ./swmr_generator echo launch the swmr_writer ./swmr_writer $Nrecords & +pid_write=$! + # launch readers n=0 echo launch $Nreaders swmr_readers while [ $n -lt $Nreaders ]; do ./swmr_reader $Nsecs & + pid_readers="$pid_readers $!" n=`expr $n + 1` done -wait +echo pid_write=$pid_write +echo pid_readers=$pid_readers +ps + +# collect exit code of the readers. +for xpid in $pid_readers; do + echo checked reader $xpid + wait $xpid + if test $? -ne 0; then + echo reader had error + nerrors=`expr $nerrors + 1` + fi +done +# collect exit code of the writer +echo checked write $pid_writer +wait $pid_writer +if test $? -ne 0; then + echo writer had error + nerrors=`expr $nerrors + 1` +fi # ############################################################################## # # END # ############################################################################## +echo nerrors=$nerrors if test $nerrors -eq 0 ; then echo "SWMR tests passed." fi -- cgit v0.12