From: David Engster Date: Tue, 19 Oct 2010 15:04:31 +0000 (+0200) Subject: * cit-test.sh: Add support for running in batch mode. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c9de94f85bf4e0bdd97597a4272de74d2e1472d1;p=emacs.git * cit-test.sh: Add support for running in batch mode. --- diff --git a/test/manual/cedet/cit-test.sh b/test/manual/cedet/cit-test.sh index 89d1568ff7c..53dd57d56f6 100755 --- a/test/manual/cedet/cit-test.sh +++ b/test/manual/cedet/cit-test.sh @@ -1,18 +1,27 @@ #!/bin/sh -EMACS=${EMACS:-emacs}; +EMACS=${EMACS:-emacs} -STYLE=$1; +STYLE=$1 if [ -z $1 ]; then STYLE=Make fi +# Further Emacs options (like --batch) +OPTIONS=$2 + rm -r /tmp/CEDET_INTEG* -if $EMACS -q -l ../common/cedet.el -l cit-load.el -f toggle-debug-on-error -f toggle-debug-on-quit -f cedet-integ-test-${STYLE}; then - # Reverse the meaning of a 0 exit status, as the user had to quit Emacs - # but on success, the program kills emacs with 1 (to be different.) - exit 1; +$EMACS $OPTIONS -q -l ../common/cedet.el -l cit-load.el -f toggle-debug-on-error -f toggle-debug-on-quit -f cedet-integ-test-${STYLE} +EXITCODE=$? + +if [ $EXITCODE -eq 0 ]; then + # Reverse the meaning of a 0 exit status, as the user had to quit Emacs. + exit 1 +elif [ $EXITCODE -eq 1 ]; then + # On success, the program kills emacs with 1 (to be different.) + exit 0 else - exit 0; -fi \ No newline at end of file + # Otherwise, Emacs might have an error running in batch mode, and we return it. + exit $EXITCODE +fi