{"thread":{"id":"25198","subject":"[PATCH 0/3] Testing installed gitweb","startedAt":"2010-09-22T14:21:23Z","lastAt":"2010-09-22T14:21:26Z","messageCount":4,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"151294","messageId":"1285165286-12452-1-git-send-email-jnareb@gmail.com","threadId":"25198","inReplyTo":null,"subject":"[PATCH 0/3] Testing installed gitweb","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-22T14:21:23Z","receivedAt":"2010-09-22T14:21:23Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"This series add a mechanism to easy test installed gitweb, via\n\n  $ make -C gitweb test-installed\n\nThis way we can check if the install procedure work correctly, when\ngitweb gets split into smaller modules.\n\nThis series applies on top of 'jn/gitweb-test-lib' branch, merged as\n4621733 into next, i.e. on top of commit 89d1b5b (t/gitweb-lib.sh: Use\ntabs for indent consistently, 2010-09-12).\n\nJakub Narebski (3):\n  gitweb/Makefile: Include gitweb/config.mak\n  t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED\n  gitweb/Makefile: Add test-installed target\n\n gitweb/Makefile |    5 +++++\n t/Makefile      |    4 ++++\n t/gitweb-lib.sh |   21 +++++++++++++++++++--\n 3 files changed, 28 insertions(+), 2 deletions(-)\n\n-- \n1.7.2.1\n"},{"id":"151295","messageId":"1285165286-12452-2-git-send-email-jnareb@gmail.com","threadId":"25198","inReplyTo":"1285165286-12452-1-git-send-email-jnareb@gmail.com","subject":"[PATCH/RFC 1/3] gitweb/Makefile: Include gitweb/config.mak","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-22T14:21:24Z","receivedAt":"2010-09-22T14:21:24Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Allow for gitweb-specific Makefile config to reside in config.mak file\nin the 'gitweb/' subdirectory.  This means that gitweb-specific\nbuild-time configuration variable can reside in gitweb-specific\ngitweb/config.mak\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nI'm not sure if it is really neccessary, and useful.  Still...\nThis patch can be safely dropped from this series.\n\n gitweb/Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/Makefile b/gitweb/Makefile\nindex 2fb7c2d..88bcf08 100644\n--- a/gitweb/Makefile\n+++ b/gitweb/Makefile\n@@ -39,6 +39,7 @@ GITWEB_SITE_FOOTER =\n # include user config\n -include ../config.mak.autogen\n -include ../config.mak\n+-include config.mak\n \n # determine version\n ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE\n-- \n1.7.2.1\n"},{"id":"151296","messageId":"1285165286-12452-3-git-send-email-jnareb@gmail.com","threadId":"25198","inReplyTo":"1285165286-12452-1-git-send-email-jnareb@gmail.com","subject":"[PATCHv2 2/3] t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-22T14:21:25Z","receivedAt":"2010-09-22T14:21:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"You can set the GITWEB_TEST_INSTALLED environment variable to the\ngitwebdir (the directory where gitweb is installed / deployed to) of\nan existing gitweb instalation, or to the pathname of installed gitweb\nscript, to test that installation.\n\nThis change is intended to make it possible to test that process of\ninstalling gitweb and the modules it depends on works correctly (after\nsplitting gitweb).\n\nIf GITWEB_TEST_INSTALLED is used, print what script are we testing\nto make it easy to spot that we test installed gitweb.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis patch differs from previous version, send to git mailing list as\nhttp://thread.gmane.org/gmane.comp.version-control.git/156023/focus=156025\nin the following way:\n\n* It is no longer marked as RFC, as it was decided that description of\n  GITWEB_TEST_INSTALLED in t/gitweb-lib.sh is enough, and there is no\n  need to mention this variable in some of t/README, gitweb/README, or\n  gitweb/INSTALL\n\n* GITWEB_TEST_INSTALLED can be either directory where gitweb.cgi is\n  installed, or a path to gitweb.cgi\n\n* t/test-lib.sh now prints where resides gitweb.cgi it is testing if\n  GITWEB_TEST_INSTALLED is set.\n\n\n t/gitweb-lib.sh |   21 +++++++++++++++++++--\n 1 files changed, 19 insertions(+), 2 deletions(-)\n\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 8c490c8..8b5b987 100755\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -32,17 +32,34 @@ EOF\n \tcat >.git/description <<EOF\n $0 test repository\n EOF\n+\n+\t# You can set the GITWEB_TEST_INSTALLED environment variable to\n+\t# the gitwebdir (the directory where gitweb is installed / deployed to)\n+\t# of an existing gitweb instalation to test that installation,\n+\t# or simply to pathname of installed gitweb script.\n+\tif test -n \"$GITWEB_TEST_INSTALLED\" ; then\n+\t\tif test -d $GITWEB_TEST_INSTALLED; then\n+\t\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED/gitweb.cgi\"\n+\t\telse\n+\t\t\tSCRIPT_NAME=\"$GITWEB_TEST_INSTALLED\"\n+\t\tfi\n+\t\ttest -f \"$SCRIPT_NAME\" ||\n+\t\terror \"Cannot find gitweb at $GITWEB_TEST_INSTALLED.\"\n+\t\tsay \"# Testing $SCRIPT_NAME\"\n+\telse # normal case, use source version of gitweb\n+\t\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n+\tfi\n+\texport SCRIPT_NAME\n }\n \n gitweb_run () {\n \tGATEWAY_INTERFACE='CGI/1.1'\n \tHTTP_ACCEPT='*/*'\n \tREQUEST_METHOD='GET'\n-\tSCRIPT_NAME=\"$GIT_BUILD_DIR/gitweb/gitweb.perl\"\n \tQUERY_STRING=\"\"$1\"\"\n \tPATH_INFO=\"\"$2\"\"\n \texport GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \\\n-\t\tSCRIPT_NAME QUERY_STRING PATH_INFO\n+\t\tQUERY_STRING PATH_INFO\n \n \tGITWEB_CONFIG=$(pwd)/gitweb_config.perl\n \texport GITWEB_CONFIG\n-- \n1.7.2.1\n"},{"id":"151297","messageId":"1285165286-12452-4-git-send-email-jnareb@gmail.com","threadId":"25198","inReplyTo":"1285165286-12452-1-git-send-email-jnareb@gmail.com","subject":"[RFC/PATCH 3/3] gitweb/Makefile: Add test-installed target","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-22T14:21:26Z","receivedAt":"2010-09-22T14:21:26Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"The 'test-installed' target in gitweb/Makefile installs and tests\ninstalled gitweb.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nRFC, because I am not 100% sure that 'test-installed' should have\n'install' target as a dependency.\n\nProbably should be marked .PHONY, but then there are some other\ntargets that should be marked such beside 'test-installed'.\n\nThe t/Makefile part is fairly uncontroversial, I think.\n\n gitweb/Makefile |    4 ++++\n t/Makefile      |    4 ++++\n 2 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/Makefile b/gitweb/Makefile\nindex 88bcf08..90f7212 100644\n--- a/gitweb/Makefile\n+++ b/gitweb/Makefile\n@@ -152,6 +152,10 @@ install: all\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'\n \t$(INSTALL) -m 644 $(GITWEB_FILES) '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'\n \n+test-installed: install\n+\tGITWEB_TEST_INSTALLED='$(DESTDIR_SQ)$(gitwebdir_SQ)' \\\n+\t\t$(MAKE) -C ../t gitweb-test\n+\n ### Cleaning rules\n \n clean:\ndiff --git a/t/Makefile b/t/Makefile\nindex c7baefb..7aa409a 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -17,6 +17,7 @@ SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n \n T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)\n TSVN = $(wildcard t91[0-9][0-9]-*.sh)\n+TGITWEB = $(wildcard t95[0-9][0-9]-*.sh)\n \n all: pre-clean\n \t$(MAKE) aggregate-results-and-cleanup\n@@ -46,6 +47,9 @@ full-svn-test:\n \t$(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C\n \t$(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8\n \n+gitweb-test:\n+\t$(MAKE) $(TGITWEB)\n+\n valgrind:\n \tGIT_TEST_OPTS=--valgrind $(MAKE)\n \n-- \n1.7.2.1\n"}]}