From 5dccbe2d6adf58edfa165af681bc870bae6c400c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 20 Oct 2010 15:57:45 -0400 Subject: [PATCH 1/1] Also cleanup local mpd if the pysawsim nosetests fail. --- misc/hooks/pre-commit-pysawsim-check | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/misc/hooks/pre-commit-pysawsim-check b/misc/hooks/pre-commit-pysawsim-check index 66a409d..6e4f27b 100755 --- a/misc/hooks/pre-commit-pysawsim-check +++ b/misc/hooks/pre-commit-pysawsim-check @@ -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 -- 2.26.2