git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 shell
        or, more directly,
            exec {'/bin/csh'} '-sh';	# pretend it's a login shell
Show 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.
Previous: Lea WiemannNext: Lea Wiemann
Message 24 of 41 in “gitweb: Use Test::WWW::Mechanize::CGI to test gitweb output”
  1. gitweb: Use Test::WWW::Mechanize::CGI to test gitweb outputJakub Narebski, Jun 14, 2008
  2. Lea WiemannJun 14, 2008
  3. Jakub NarebskiJun 14, 2008
  4. Lea WiemannJun 14, 2008
  5. Jakub NarebskiJun 14, 2008
  6. Lea WiemannJun 14, 2008
  7. Jakub NarebskiJun 15, 2008
  8. Lea WiemannJun 14, 2008
  9. Jakub NarebskiJun 14, 2008
  10. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 14, 2008
  11. Jakub NarebskiJun 15, 2008
  12. Lea WiemannJun 15, 2008
  13. Jakub NarebskiJun 16, 2008
  14. Lea WiemannJun 16, 2008
  15. Jakub NarebskiJun 16, 2008
  16. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 20, 2008
  17. Jakub NarebskiJun 20, 2008
  18. Lea WiemannJun 20, 2008
  19. Jakub NarebskiJun 20, 2008
  20. Lea WiemannJun 20, 2008
  21. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 20, 2008
  22. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 23, 2008
  23. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 23, 2008
  24. Junio C HamanoJun 23, 2008
  25. Lea WiemannJun 23, 2008
  26. Jakub NarebskiJun 23, 2008
  27. Lea WiemannJun 23, 2008
  28. Jakub NarebskiJun 23, 2008
  29. Lea WiemannJun 24, 2008
  30. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 24, 2008
  31. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 26, 2008
  32. gitweb: add test suite with Test::WWW::Mechanize::CGILea Wiemann, Jun 26, 2008
  33. Jakub NarebskiJun 29, 2008
  34. Lea WiemannJun 29, 2008
  35. Jakub NarebskiJun 29, 2008
  36. Lea WiemannJun 30, 2008
  37. Jakub NarebskiJun 30, 2008
  38. Junio C HamanoJun 24, 2008
  39. Lea WiemannJun 24, 2008
  40. Jakub NarebskiJun 24, 2008
  41. Jakub NarebskiJun 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.