{"thread":{"id":"25250","subject":"[PATCHv2 0/3] Testing installed gitweb","startedAt":"2010-09-26T13:02:23Z","lastAt":"2010-09-26T13:02:26Z","messageCount":4,"participants":["Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"151712","messageId":"1285506146-8009-1-git-send-email-jnareb@gmail.com","threadId":"25250","inReplyTo":null,"subject":"[PATCHv2 0/3] Testing installed gitweb","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-26T13:02:23Z","receivedAt":"2010-09-26T13:02:23Z","isPatch":false,"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\n\nThe major change from previous version is that 'test-installed' target\nno longer depends on 'install', which means that it doesn't force\ninstalling gitweb each time it is run.\n\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' and 'test-installed' targets\n\n gitweb/Makefile |   12 +++++++++++-\n t/Makefile      |    4 ++++\n t/gitweb-lib.sh |   21 +++++++++++++++++++--\n 3 files changed, 34 insertions(+), 3 deletions(-)\n\n-- \n1.7.3\n"},{"id":"151713","messageId":"1285506146-8009-2-git-send-email-jnareb@gmail.com","threadId":"25250","inReplyTo":"1285506146-8009-1-git-send-email-jnareb@gmail.com","subject":"[PATCHv2 1/3] gitweb/Makefile: Include gitweb/config.mak","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-26T13:02:24Z","receivedAt":"2010-09-26T13:02:24Z","isPatch":false,"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---\nNo longer RFC, but it can still 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.3\n"},{"id":"151715","messageId":"1285506146-8009-3-git-send-email-jnareb@gmail.com","threadId":"25250","inReplyTo":"1285506146-8009-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-26T13:02:25Z","receivedAt":"2010-09-26T13:02: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---\nNo change from previous version.\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.3\n"},{"id":"151714","messageId":"1285506146-8009-4-git-send-email-jnareb@gmail.com","threadId":"25250","inReplyTo":"1285506146-8009-1-git-send-email-jnareb@gmail.com","subject":"[PATCHv2 3/3] gitweb/Makefile: Add 'test' and 'test-installed' targets","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-26T13:02:26Z","receivedAt":"2010-09-26T13:02:26Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"The 'test-installed' target in gitweb/Makefile tests installed gitweb,\nusing the same destination directory that 'install' target uses.\n\nThe 'test' target is just a convenience wrapper invoking 'gitweb-test'\ntarget of t/Makefile.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nChanges from previous version:\n\n* 'test-installed' no longer has 'install' as requirement, which means that\n  testing installed target does not force an install.  We cannot check easily\n  and reliably that install is fresh.\n\n* Added 'test' convenience target.\n\n* Moved \"Testing rules\" section before \"Installation rules\", the way it is done\n  in main Makefile.\n\n gitweb/Makefile |   11 ++++++++++-\n t/Makefile      |    4 ++++\n 2 files changed, 14 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/Makefile b/gitweb/Makefile\nindex 88bcf08..df908a1 100644\n--- a/gitweb/Makefile\n+++ b/gitweb/Makefile\n@@ -144,6 +144,15 @@ gitweb.cgi: gitweb.perl GITWEB-BUILD-OPTIONS\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n \n+### Testing rules\n+\n+test:\n+\t$(MAKE) -C ../t gitweb-test\n+\n+test-installed:\n+\tGITWEB_TEST_INSTALLED='$(DESTDIR_SQ)$(gitwebdir_SQ)' \\\n+\t\t$(MAKE) -C ../t gitweb-test\n+\n ### Installation rules\n \n install: all\n@@ -157,5 +166,5 @@ install: all\n clean:\n \t$(RM) gitweb.cgi static/gitweb.min.js static/gitweb.min.css GITWEB-BUILD-OPTIONS\n \n-.PHONY: all clean install .FORCE-GIT-VERSION-FILE FORCE\n+.PHONY: all clean install test test-installed .FORCE-GIT-VERSION-FILE FORCE\n \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.3\n"}]}