summaryrefslogtreecommitdiff
path: root/t/gitweb-lib.sh
Commit message (Collapse)AuthorAgeFilesLines
* t/gitweb-lib.sh: Ensure that errors are shown for --debug --immediateÆvar Arnfjörð Bjarmason2011-02-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | Because '--immediate' stops test suite after first error, therefore in this mode test_debug 'cat gitweb.log' was never ran, thus in effect negating effect of '--debug' option. This made finidng the cause of errors in gitweb test sute difficult. Modify the gitweb_run test subroutine to run test_debug itself in the case of errors (and also remove "test_debug 'cat gitweb.log'" from gitweb tests). This makes it possible to run *gitweb tests* with --immediate ---debug combination of options; also it makes gitweb tests to not output spurious debug data that is not considered error. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'bg/maint-gitweb-test-lib'Junio C Hamano2010-11-171-1/+1
|\ | | | | | | | | | | | | | | * bg/maint-gitweb-test-lib: t/gitweb-lib: Don't pass constant to decode_utf8 Conflicts: t/gitweb-lib.sh
| * t/gitweb-lib: Don't pass constant to decode_utf8Brian Gernhardt2010-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encode.pm started updating the string to decode in-place when a second argument is passed in version 2.40. This causes 'decode_utf8("", Encode::FB_CROAK)' to die with a message like: Modification of a read-only value attempted at .../Encode.pm line 216. Work around this by passing an empty variable instead of a constant string. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLEDJakub Narebski2010-09-301-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/gitweb-lib.sh: Use tabs for indent consistentlyJakub Narebski2010-09-121-2/+2
| | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/gitweb-lib.sh: Use GIT_BUILD_DIRJakub Narebski2010-09-121-4/+4
|/ | | | | | | | Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY/.." (both defined in t/test-lib.sh) in t/gitweb-lib.sh. It better describes the intent. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* tests: Use skip_all=* to skip testsÆvar Arnfjörð Bjarmason2010-07-081-2/+2
| | | | | | | | | | | | Change tests to skip with skip_all=* + test_done instead of using say + test_done. This is a follow-up to "tests: Skip tests in a way that makes sense under TAP" (fadb5156e4). I missed these cases when prepearing that patch, hopefully this is all of them. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Move static files into seperate subdirectoryPavan Kumar Sunkara2010-05-311-3/+3
| | | | | | | | | | | | | | | | | | | Create a new subdirectory called 'static' in gitweb/, and move all static files required by gitweb.cgi when running, which means styles, images and Javascript code. This should make gitweb more readable and easier to maintain. Update t/gitweb-lib.sh to reflect this change.The install-gitweb now also include moving of static files into 'static' subdirectory in target directory: update Makefile, gitweb's INSTALL, README and Makefile accordingly. Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Petr Baudis <pasky@ucw.cz> Acked-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Load checkingJohn 'Warthog9' Hawley2010-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This changes slightly the behavior of gitweb, so that it verifies that the box isn't inundated with before attempting to serve gitweb. If the box is overloaded, it basically returns a 503 Server Unavailable until the load falls below the defined threshold. This helps dramatically if you have a box that's I/O bound, reaches a certain load and you don't want gitweb, the I/O hog that it is, increasing the pain the server is already undergoing. This behavior is controlled by $maxload configuration variable. Default is a load of 300, which for most cases should never be hit. Unset it (set it to undefined value, i.e. undef) to turn off checking. Currently it requires that '/proc/loadavg' file exists, otherwise the load check is bypassed (load is taken to be 0). So platforms that do not implement '/proc/loadavg' currently cannot use this feature (provisions are included for additional checks to be added by others). There is simple test in t/t9501-gitweb-standalone-http-status.sh to check that it correctly returns "503 Service Unavailable" if load is too high, and also if there are any Perl warnings or errors. Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t/gitweb-lib: Split HTTP response with non-GNU sedBrian Gernhardt2009-11-231-2/+12
| | | | | | | | | | Recognizing \r in a regex is something GNU sed will do, but other sed implementation's won't (e.g. BSD sed on OS X). Instead of two sed invocations, use a single Perl script to split output into headers and body. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t/gitweb-lib.sh: Split gitweb output into headers and bodyJakub Narebski2009-10-301-1/+5
| | | | | | | | Save HTTP headers into gitweb.headers, and the body of message into gitweb.body in gitweb_run() Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: split test suite into library and testsMark Rada2009-08-271-0/+73
To accommodate additions to the test cases for gitweb, the preamble from t9500 is now in its own library so that new sets of tests for gitweb can use the same setup without copying the code. Signed-off-by: Mark Rada <marada@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>