diff options
author | Jeff King <peff@peff.net> | 2009-02-25 03:32:08 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-26 00:49:44 -0800 |
commit | 75318a3bad4b7a25f617217891bfbcec26a9161a (patch) | |
tree | d45c6de5a4621d7dedbb0203545ccaa9045b4d56 /t/lib-httpd.sh | |
parent | 661763abf6e13eabf0aa1a3eefd364d32da8f4ad (diff) | |
download | git-75318a3bad4b7a25f617217891bfbcec26a9161a.tar.gz |
test scripts: refactor start_httpd helper
There are some redirects and some error checking that need
to be done by the caller; let's move both into the
start_httpd function so that all callers don't have to
repeat them (there is only one caller now, but another will
follow in this series).
This doesn't violate any assumptions that aren't already
being made by lib-httpd, which is happy to say "skipping"
and call test_done for a number of other cases.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-httpd.sh')
-rw-r--r-- | t/lib-httpd.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh index 86cdebc727..589aaf8214 100644 --- a/t/lib-httpd.sh +++ b/t/lib-httpd.sh @@ -94,13 +94,18 @@ prepare_httpd() { } start_httpd() { - prepare_httpd + prepare_httpd >&3 2>&4 trap 'stop_httpd; 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 $? = 0; then + say "skipping test, web server setup failed" + test_done + fi } stop_httpd() { |