From: W. Trevor King Date: Wed, 20 Oct 2010 19:57:45 +0000 (-0400) Subject: Also cleanup local mpd if the pysawsim nosetests fail. X-Git-Url: http://git.tremily.us/?p=sawsim.git;a=commitdiff_plain;h=5dccbe2d6adf58edfa165af681bc870bae6c400c;hp=2192e9c74e1cf869ba8be0e7a85bc018248698d5 Also cleanup local mpd if the pysawsim nosetests fail. --- 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