Re: [PATCH v6] gitweb: add test suite with Test::WWW::Mechanize::CGI
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 23, 2008, 02:30 UTC
- Message-ID
- <7vd4m8khmb.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1214183688-8544-1-git-send-email-LeWiemann@gmail.com>
Lea Wiemann <lewiemann@gmail.com> writes:
Show 13 quoted lines
> Changed since v5: honor $ENV{GITPERL} for gitweb.cgi execution, not
> just test execution:
>
> diff --git a/t/t9503/test.pl b/t/t9503/test.pl
> index 28894c5..947e2e8 100755
> --- a/t/t9503/test.pl
> +++ b/t/t9503/test.pl
> @@ -54,5 +54,5 @@ my $gitweb = abs_path(File::Spec->catfile('..', '..', 'gitweb', 'gitweb.cgi'));
> my $cgi = sub {
> # Use exec, not the shell, to support blanks in the path.
> - my $status = system $gitweb $gitweb;
> + my $status = system { $ENV{GITPERL} } $ENV{GITPERL}, $gitweb;
> my $value = $status >> 8;My Perl must be getting rusty. I had to look up this tricky syntax in perlfunc.pod, under "=item exec", with examples like:
$shell = '/bin/csh';
exec $shell '-sh'; # pretend it's a login shellor, more directly,
exec {'/bin/csh'} '-sh'; # pretend it's a login shellShow 17 quoted lines
> t/t9503-gitweb-Mechanize.sh | 132 ++++++++++++++++ > t/t9503/test.pl | 354 +++++++++++++++++++++++++++++++++++++++++++ > t/test-lib.sh | 2 + > 3 files changed, 488 insertions(+), 0 deletions(-) > create mode 100755 t/t9503-gitweb-Mechanize.sh > create mode 100755 t/t9503/test.pl > > diff --git a/t/t9503-gitweb-Mechanize.sh b/t/t9503-gitweb-Mechanize.sh > new file mode 100755 > index 0000000..3fe6d8b > --- /dev/null > +++ b/t/t9503-gitweb-Mechanize.sh > @@ -0,0 +1,132 @@ > +#!/bin/sh > +# > +# Copyright (c) 2008 Jakub Narebski > +# Copyright (c) 2008 Lea Wiemann
If you mean by this that originally Jakub started and then Lea continued extending the work, probably the order of Sign-off should match that order to express the patch flow trail better.
Show 14 quoted lines
> +# check if test can be run
> +"$GITPERL" -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
> + test_expect_success \
> + 'skipping gitweb tests, perl version is too old' :
> + test_done
> + exit
> +}
> +
> +"$GITPERL" -MTest::WWW::Mechanize::CGI -e '' >/dev/null 2>&1 || {
> + test_expect_success \
> + 'skipping gitweb tests, Test::WWW::Mechanize::CGI not found' :
> + test_done
> + exit
> +}Nice touch.