Subject: Re: [RFC/PATCH (WIP)] gitweb: Use Test::WWW::Mechanize::CGI to test gitweb output

From: Jakub Narebski <[email-masked]>
Date: Sat, 14 Jun 2008 20:31:46 +0200

Lea Wiemann wrote:
> Jakub Narebski wrote:
> >
> > +	skip "Could not get $pagename", 2 + $lint_installed
> > +		unless $mech->get_ok('http://localhost/', "GET $pagename");
> 
> Just noticed this -- here's the cause of the problem I encountered in my 
> previous post.
> 
> You can't really probe for a running gitweb installation on localhost, 
> because even if there's one, you don't know if you're testing against 
> your tree and your test repo.

Errr... WWW::Mechanize::CGI does not access web server, but runs CGI
script (or CGI subroutine) as if it was installed in the root directory
of localhost.  'http://localhost' simply means installed CGI script.

For example tests works for me, even though I have gitweb installed
somewhere deeper than directly at locahost:
  http://localhost/cgi-bin/gitweb/gitweb.cgi
Besides you can check output and see that it is consistent with set
and used gitweb config in t9503* test.

Test::WWW::Mechanize::CGI has the following description:
http://search.cpan.org/~mramberg/Test-WWW-Mechanize-CGI-0.1/lib/Test/WWW/Mechanize/CGI.pm

  Provides a convenient way of testing CGI applications without a external
  daemon.

The documentation of module (0.1 in the case of TWM::CGI, 0.3 in the
case of WM::CGI) leaves something to be desired, so I mainly used
examples provided as guideline.

-- 
Jakub Narebski
Poland