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>
This commit is contained in:

committed by
Junio C Hamano

parent
6e7b5aaf40
commit
a5adcbe377
@ -93,14 +93,16 @@ prepare_httpd() {
|
|||||||
start_httpd() {
|
start_httpd() {
|
||||||
prepare_httpd >&3 2>&4
|
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" \
|
"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
|
||||||
-f "$TEST_PATH/apache.conf" $HTTPD_PARA \
|
-f "$TEST_PATH/apache.conf" $HTTPD_PARA \
|
||||||
-c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \
|
-c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \
|
||||||
>&3 2>&4
|
>&3 2>&4
|
||||||
if ! test $? = 0; then
|
if test $? -ne 0
|
||||||
|
then
|
||||||
say "skipping test, web server setup failed"
|
say "skipping test, web server setup failed"
|
||||||
|
trap 'die' EXIT
|
||||||
test_done
|
test_done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user