diff options
| author | Junio C Hamano <gitster@pobox.com> | 2010-11-17 14:59:22 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2010-11-17 14:59:22 -0800 |
| commit | 430fac9e5bdf24a2969f854ff0ff376140f88090 (patch) | |
| tree | 97af5770aa6afef8fc1739ca5496b1c3ca6ce869 /t/gitweb-lib.sh | |
| parent | 8cf666c9eea7d6c40784efde545c9d00edea1959 (diff) | |
| parent | 9b93aeb29cea16880926bc150ac31cfb31475a44 (diff) | |
| download | git-430fac9e5bdf24a2969f854ff0ff376140f88090.tar.xz | |
Merge branch 'jn/gitweb-test'
* jn/gitweb-test:
gitweb/Makefile: Include gitweb/config.mak
gitweb/Makefile: Add 'test' and 'test-installed' targets
t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED
gitweb: Move call to evaluate_git_version after evaluate_gitweb_config
Diffstat (limited to 't/gitweb-lib.sh')
| -rw-r--r-- | t/gitweb-lib.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh index 8c490c8707..8b5b987f45 100644 --- a/t/gitweb-lib.sh +++ b/t/gitweb-lib.sh @@ -32,17 +32,34 @@ EOF cat >.git/description <<EOF $0 test repository EOF + + # You can set the GITWEB_TEST_INSTALLED environment variable to + # the gitwebdir (the directory where gitweb is installed / deployed to) + # of an existing gitweb instalation to test that installation, + # or simply to pathname of installed gitweb script. + if test -n "$GITWEB_TEST_INSTALLED" ; then + if test -d $GITWEB_TEST_INSTALLED; then + SCRIPT_NAME="$GITWEB_TEST_INSTALLED/gitweb.cgi" + else + SCRIPT_NAME="$GITWEB_TEST_INSTALLED" + fi + test -f "$SCRIPT_NAME" || + error "Cannot find gitweb at $GITWEB_TEST_INSTALLED." + say "# Testing $SCRIPT_NAME" + else # normal case, use source version of gitweb + SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.perl" + fi + export SCRIPT_NAME } gitweb_run () { GATEWAY_INTERFACE='CGI/1.1' HTTP_ACCEPT='*/*' REQUEST_METHOD='GET' - SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.perl" QUERY_STRING=""$1"" PATH_INFO=""$2"" export GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \ - SCRIPT_NAME QUERY_STRING PATH_INFO + QUERY_STRING PATH_INFO GITWEB_CONFIG=$(pwd)/gitweb_config.perl export GITWEB_CONFIG |
