* [PATCH] t9500: skip gitweb tests if perl version is too old
@ 2007-06-22 15:49 Sven Verdoolaege
2007-06-23 6:31 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Sven Verdoolaege @ 2007-06-22 15:49 UTC (permalink / raw)
To: git, Junio C Hamano
gitweb calls Encode::decode_utf8 with two arguments,
but old versions of perl only allow this function to be called
with one argument. Even older versions of perl do not even
have an Encode module.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
t/t9500-gitweb-standalone-no-errors.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 44ae503..d948724 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -60,6 +60,12 @@ gitweb_run () {
. ./test-lib.sh
+perl -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
+}
+
gitweb_init
# ----------------------------------------------------------------------
--
1.5.2.2.249.g45fd
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] t9500: skip gitweb tests if perl version is too old
2007-06-22 15:49 [PATCH] t9500: skip gitweb tests if perl version is too old Sven Verdoolaege
@ 2007-06-23 6:31 ` Junio C Hamano
2007-06-23 8:57 ` Sven Verdoolaege
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-06-23 6:31 UTC (permalink / raw)
To: skimo; +Cc: git
Sven Verdoolaege <skimo@kotnet.org> writes:
> gitweb calls Encode::decode_utf8 with two arguments,
> but old versions of perl only allow this function to be called
> with one argument. Even older versions of perl do not even
> have an Encode module.
>
> Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
> ---
> t/t9500-gitweb-standalone-no-errors.sh | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
> index 44ae503..d948724 100755
> --- a/t/t9500-gitweb-standalone-no-errors.sh
> +++ b/t/t9500-gitweb-standalone-no-errors.sh
> @@ -60,6 +60,12 @@ gitweb_run () {
>
> . ./test-lib.sh
>
> +perl -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
> +}
> +
Hmph. Even something silly like:
perl -MEncode -e 'decode_utf8("", Encode::FB_CLUCK)'
seem to succeed for me with 5.8.8.
Maybe you would want "perl -w" there instead?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] t9500: skip gitweb tests if perl version is too old
2007-06-23 6:31 ` Junio C Hamano
@ 2007-06-23 8:57 ` Sven Verdoolaege
2007-06-23 10:14 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Sven Verdoolaege @ 2007-06-23 8:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Fri, Jun 22, 2007 at 11:31:40PM -0700, Junio C Hamano wrote:
> Sven Verdoolaege <skimo@kotnet.org> writes:
> > +perl -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
> > +}
> > +
>
> Hmph. Even something silly like:
>
> perl -MEncode -e 'decode_utf8("", Encode::FB_CLUCK)'
>
> seem to succeed for me with 5.8.8.
>
Maybe I'm missing something, but it's supposed to succeed
for perl versions that are recent enough.
I get
bash-3.00$ perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)'
Too many arguments for Encode::decode_utf8 at -e line 1, at end of line
Execution of -e aborted due to compilation errors.
bash-3.00$ perl --version
This is perl, v5.8.0 built for i686-linux-thread-multi
Copyright 1987-2002, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
(See also http://article.gmane.org/gmane.comp.version-control.git/50354)
skimo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] t9500: skip gitweb tests if perl version is too old
2007-06-23 8:57 ` Sven Verdoolaege
@ 2007-06-23 10:14 ` Junio C Hamano
2007-06-23 10:51 ` Sven Verdoolaege
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-06-23 10:14 UTC (permalink / raw)
To: skimo; +Cc: git
Sven Verdoolaege <skimo@kotnet.org> writes:
> On Fri, Jun 22, 2007 at 11:31:40PM -0700, Junio C Hamano wrote:
>> Sven Verdoolaege <skimo@kotnet.org> writes:
>> > +perl -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
>> > +}
>> > +
>>
>> Hmph. Even something silly like:
>>
>> perl -MEncode -e 'decode_utf8("", Encode::FB_CLUCK)'
>>
>> seem to succeed for me with 5.8.8.
>>
>
> Maybe I'm missing something, but it's supposed to succeed
> for perl versions that are recent enough.
Well, "Encode::FB_CLUCK" is a bogus symbol even in recent Perl.
IOW, the tested function does not seem to care if I give
whatever garbage as the second parameter.
But I guess you are only interested if the perl used to run
gitweb barfs with that two parameter, so the original check
would be the right way.
Will apply, but I am about to go to bed, so it will be
tomorrow.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] t9500: skip gitweb tests if perl version is too old
2007-06-23 10:14 ` Junio C Hamano
@ 2007-06-23 10:51 ` Sven Verdoolaege
0 siblings, 0 replies; 5+ messages in thread
From: Sven Verdoolaege @ 2007-06-23 10:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Sat, Jun 23, 2007 at 03:14:08AM -0700, Junio C Hamano wrote:
> Well, "Encode::FB_CLUCK" is a bogus symbol even in recent Perl.
> IOW, the tested function does not seem to care if I give
> whatever garbage as the second parameter.
>
> But I guess you are only interested if the perl used to run
> gitweb barfs with that two parameter, so the original check
> would be the right way.
Indeed. gitweb doesn't use FB_CLUCK and if it did, we would
want to know about it (and not skip the tests).
skimo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-06-23 10:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-22 15:49 [PATCH] t9500: skip gitweb tests if perl version is too old Sven Verdoolaege
2007-06-23 6:31 ` Junio C Hamano
2007-06-23 8:57 ` Sven Verdoolaege
2007-06-23 10:14 ` Junio C Hamano
2007-06-23 10:51 ` Sven Verdoolaege
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).