@matheusbsbs / matheus-bagliano / commits / a5adcbe377
Fork 0

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>

Clemens Buchacher committed Jun 1, 2009 at 14:28 UTC a5adcbe377de7c8f5d794fce1fe2b23a0bddf758
1 file changed +4 -2
t/lib-httpd.sh
+4 -2
@@ -93,14 +93,16 @@ prepare_httpd() {
93 start_httpd() {
94 prepare_httpd >&3 2>&4
95
96 - trap 'stop_httpd; die' EXIT
96 + trap 'code=$?; stop_httpd; (exit $code); die' EXIT
97
98 "$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
99 -f "$TEST_PATH/apache.conf" $HTTPD_PARA \
100 -c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \
101 >&3 2>&4
102 - if ! test $? = 0; then
102 + if test $? -ne 0
103 + then
104 say "skipping test, web server setup failed"
105 + trap 'die' EXIT
106 test_done
107 fi
108 }