From 8ff76f4c3b4e72ac8259465bdf6e33f4da19170d Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sun, 26 Sep 2010 13:34:56 +0200 Subject: gitweb: Move call to evaluate_git_version after evaluate_gitweb_config Now evaluate_git_version() is inside run_request() to be called for each request, instead of once per starting gitweb; this currently matters only when using FastCGI interface (gitweb.fcgi). This change was done because evaluate_git_version() uses $GIT variable, which can be set / modified by gitweb config file, but the variable is modified this way by gitweb config file used in gitweb tests. Without this change there is spurious extra output from t9500 test when tests are run with '--debug' option. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index a85e2f6..d521b4c 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1061,6 +1061,7 @@ sub run_request { evaluate_uri(); evaluate_gitweb_config(); + evaluate_git_version(); check_loadavg(); # $projectroot and $projects_list might be set in gitweb config file @@ -1113,7 +1114,6 @@ sub evaluate_argv { sub run { evaluate_argv(); - evaluate_git_version(); $pre_listen_hook->() if $pre_listen_hook; -- cgit v0.10.2-6-g49f6 From 929909375034eb609f855fe51b2ffc57123e6dd4 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sun, 26 Sep 2010 15:02:25 +0200 Subject: t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED 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, or to the pathname of installed gitweb script, to test that installation. This change is intended to make it possible to test that process of installing gitweb and the modules it depends on works correctly (after splitting gitweb). If GITWEB_TEST_INSTALLED is used, print what script are we testing to make it easy to spot that we test installed gitweb. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh index 8c490c8..8b5b987 100644 --- a/t/gitweb-lib.sh +++ b/t/gitweb-lib.sh @@ -32,17 +32,34 @@ EOF cat >.git/description < Date: Sun, 26 Sep 2010 15:02:26 +0200 Subject: gitweb/Makefile: Add 'test' and 'test-installed' targets The 'test-installed' target in gitweb/Makefile tests installed gitweb, using the same destination directory that 'install' target uses. The 'test' target is just a convenience wrapper invoking 'gitweb-test' target of t/Makefile. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano diff --git a/gitweb/Makefile b/gitweb/Makefile index 2fb7c2d..f218074 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -143,6 +143,15 @@ gitweb.cgi: gitweb.perl GITWEB-BUILD-OPTIONS chmod +x $@+ && \ mv $@+ $@ +### Testing rules + +test: + $(MAKE) -C ../t gitweb-test + +test-installed: + GITWEB_TEST_INSTALLED='$(DESTDIR_SQ)$(gitwebdir_SQ)' \ + $(MAKE) -C ../t gitweb-test + ### Installation rules install: all @@ -156,5 +165,5 @@ install: all clean: $(RM) gitweb.cgi static/gitweb.min.js static/gitweb.min.css GITWEB-BUILD-OPTIONS -.PHONY: all clean install .FORCE-GIT-VERSION-FILE FORCE +.PHONY: all clean install test test-installed .FORCE-GIT-VERSION-FILE FORCE diff --git a/t/Makefile b/t/Makefile index c7baefb..7aa409a 100644 --- a/t/Makefile +++ b/t/Makefile @@ -17,6 +17,7 @@ SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh) TSVN = $(wildcard t91[0-9][0-9]-*.sh) +TGITWEB = $(wildcard t95[0-9][0-9]-*.sh) all: pre-clean $(MAKE) aggregate-results-and-cleanup @@ -46,6 +47,9 @@ full-svn-test: $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8 +gitweb-test: + $(MAKE) $(TGITWEB) + valgrind: GIT_TEST_OPTS=--valgrind $(MAKE) -- cgit v0.10.2-6-g49f6 From 9b93aeb29cea16880926bc150ac31cfb31475a44 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sun, 26 Sep 2010 15:02:24 +0200 Subject: gitweb/Makefile: Include gitweb/config.mak Allow for gitweb-specific Makefile config to reside in config.mak file in the 'gitweb/' subdirectory. This means that gitweb-specific build-time configuration variable can reside in gitweb-specific gitweb/config.mak Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano diff --git a/gitweb/Makefile b/gitweb/Makefile index f218074..df908a1 100644 --- a/gitweb/Makefile +++ b/gitweb/Makefile @@ -39,6 +39,7 @@ GITWEB_SITE_FOOTER = # include user config -include ../config.mak.autogen -include ../config.mak +-include config.mak # determine version ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE -- cgit v0.10.2-6-g49f6