From: Clemens Buchacher Date: Mon, 1 Jun 2009 12:28:25 +0000 (+0200) Subject: test-lib: fix http exit codes X-Git-Tag: v1.6.4-rc0~90 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a5adcbe377de7c8f5d794fce1fe2b23a0bddf758;p=git.git test-lib: fix http exit codes Previously, die() would report the exit code of stop_httpd. Instead, save and reset the exit code before dying. Signed-off-by: Clemens Buchacher Signed-off-by: Junio C Hamano --- diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh index cde659d14..6765b0806 100644 --- a/t/lib-httpd.sh +++ b/t/lib-httpd.sh @@ -93,14 +93,16 @@ prepare_httpd() { start_httpd() { prepare_httpd >&3 2>&4 - trap 'stop_httpd; die' EXIT + trap 'code=$?; stop_httpd; (exit $code); die' EXIT "$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \ -f "$TEST_PATH/apache.conf" $HTTPD_PARA \ -c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \ >&3 2>&4 - if ! test $? = 0; then + if test $? -ne 0 + then say "skipping test, web server setup failed" + trap 'die' EXIT test_done fi }