Also cleanup local mpd if the pysawsim nosetests fail.
authorW. Trevor King <wking@drexel.edu>
Wed, 20 Oct 2010 19:57:45 +0000 (15:57 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 20 Oct 2010 19:57:45 +0000 (15:57 -0400)
misc/hooks/pre-commit-pysawsim-check

index 66a409dd42238ec912e5ccf2f9b79ff8a061520c..6e4f27b13965d8a89bfe81bbd5040e48dd1ced8f 100755 (executable)
@@ -7,18 +7,23 @@ if [ -n "$HAS_MPD" ]; then
     LOCAL_MPD=''
 
     mpdtrace >/dev/null 2>&1
-    if [ "$?" != 0 ]; then
+    if [ "$?" -ne 0 ]; then
        LOCAL_MPD='1'
        mpd &    # start an mpd instance
        sleep 1  # give mpd some time to start up
     fi           # otherwise there is an mpd instance already running
 
-    mpiexec -n 1 nosetests --with-doctest --doctest-tests pysawsim || exit 1
+    mpiexec -n 1 nosetests --with-doctest --doctest-tests pysawsim
+    RESULT="$?"
 
     if [ -n "$LOCAL_MPD" ]; then
        mpdallexit
     fi
 
+    if [ "$RESULT" -ne 0 ]; then
+       exit 1;
+    fi
+
 else  # no MPD
 
     nosetests --with-doctest --doctest-tests pysawsim || exit 1