summaryrefslogtreecommitdiff
path: root/t/lib-httpd.sh
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2009-06-01 12:28:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-02 05:45:01 (GMT)
commita5adcbe377de7c8f5d794fce1fe2b23a0bddf758 (patch)
treed351f37b2c9befdf8657f6a5d0c1a855e361bd29 /t/lib-httpd.sh
parent6e7b5aaf40dac54edcbd7e0a859d26f526ef643e (diff)
downloadgit-a5adcbe377de7c8f5d794fce1fe2b23a0bddf758.zip
git-a5adcbe377de7c8f5d794fce1fe2b23a0bddf758.tar.gz
git-a5adcbe377de7c8f5d794fce1fe2b23a0bddf758.tar.bz2
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 <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-httpd.sh')
-rw-r--r--t/lib-httpd.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index cde659d..6765b08 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
}