On Sat, Feb 8, 2014 at 6:47 AM, Jeff King <peff@xxxxxxxx> wrote: > Thinking on this more, I wonder if we should just do something like > this: > > diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh > index bfdff2a..c82b4ee 100644 > --- a/t/lib-httpd.sh > +++ b/t/lib-httpd.sh > @@ -64,7 +64,9 @@ case $(uname) in > esac > > LIB_HTTPD_PATH=${LIB_HTTPD_PATH-"$DEFAULT_HTTPD_PATH"} > -LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'} > +if test -z "$LIB_HTTPD_PORT"; then > + LIB_HTTPD_PORT=${this_test#t} > +fi > > TEST_PATH="$TEST_DIRECTORY"/lib-httpd > HTTPD_ROOT_PATH="$PWD"/httpd > > and drop the manual LIB_HTTPD_PORT setting in each of the test scripts. > That would prevent this type of error in the future, and people can > still override if they want to. > > Any test scripts that are not numbered would need to set it, but we > should not have any of those (and if we did, the failure mode would be > OK, as Apache would barf on the bogus port number). Yes! Next stop, attempt to start httpd at start_httpd regardless of GIT_TEST_HTTPD. If successful, test_set_prereq HTTPD or something that the following tests can use. If GIT_TEST_HTTPD is set and start_httpd fails, error out, not set prereq. -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html