X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Flib-httpd.sh;h=6765b08065e8959dcec38940188818b952d2fcd0;hb=3f189d0ffca46dda01be99a7a8f36b7efacb0a8a;hp=86cdebc727c4964899a71366151a7782558153c7;hpb=00f97c72f22b82c6c77ae429986060832c6b6f55;p=git.git diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh index 86cdebc72..6765b0806 100644 --- a/t/lib-httpd.sh +++ b/t/lib-httpd.sh @@ -8,7 +8,6 @@ then say "skipping test, network testing disabled by default" say "(define GIT_TEST_HTTPD to enable)" test_done - exit fi HTTPD_PARA="" @@ -36,7 +35,6 @@ if ! test -x "$LIB_HTTPD_PATH" then say "skipping test, no web server found at '$LIB_HTTPD_PATH'" test_done - exit fi HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \ @@ -50,7 +48,6 @@ then then say "skipping test, at least Apache version 2 is required" test_done - exit fi LIB_HTTPD_MODULE_PATH="$DEFAULT_HTTPD_MODULE_PATH" @@ -94,13 +91,20 @@ prepare_httpd() { } start_httpd() { - prepare_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 + -c "Listen 127.0.0.1:$LIB_HTTPD_PORT" -k start \ + >&3 2>&4 + if test $? -ne 0 + then + say "skipping test, web server setup failed" + trap 'die' EXIT + test_done + fi } stop_httpd() {