Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Welcome to the Monastery
 
PerlMonks  

Problem compiling Perl 5.14.2 - op/stat.t test 37 failed

by mrthom (Novice)
on May 30, 2012 at 10:45 UTC ( #973257=perlquestion: print w/ replies, xml ) Need Help??
mrthom has asked for the wisdom of the Perl Monks concerning the following question:

Please help me with testing the compilation of Perl. I am compiling on ARMv6 Raspberry Pi on Arch Linux ARM. Compilation is OK. But then at the end of several hours harness testing there is FAIL.

reproducing the fail command in the src directory:

./perl -MTestInit t/op/stat.t

failed test 37:

not ok 37 - ls and -c agreeing on /dev (223 222) # Failed at t/op/stat.t line 292 # got "223" # expected "222"

Hey! THX i found it :D It problem in Czech localized output from this command:

ls -l /dev 2>/dev/null

Output

[tom@alarmpi perl-5.14.2]$ ls -l /dev 2>/dev/null celkem 0 crw------- 1 root root 10, 235 1. led 1970 autofs drwxr-xr-x 2 root root 620 30. kvě 09.59 block drwxr-xr-x 2 root root 60 30. kvě 09.59 bsg

The first line is "celkem" that means total in english and begins with c. So, please correct it and remove the first line from the test and post a patch please :)

I think it could be good to supply some patch like this, which works for OK:

+++ t/op/stat.t 2012-05-30 15:24:01.182106112 +0200 @@ -250,7 +250,7 @@ if $Is_VMS; my $LS = $Config{d_readlink} ? "ls -lL" : "ls -l"; - my $CMD = "$LS /dev 2>/dev/null"; + my $CMD = "$LS /dev 2>/dev/null | tail -n +2"; my $DEV = qx($CMD); skip "$CMD failed", 6 if $DEV eq '';

Comment on Problem compiling Perl 5.14.2 - op/stat.t test 37 failed
Select or Download Code
Re: Problem compiling Perl 5.14.2 - op/stat.t test 37 failed
by Eliya (Vicar) on May 30, 2012 at 11:39 UTC

    You might want to modify the respective test to figure out what ls and Perl disagree on, e.g.

    my $try = sub { # line 287 my @c1 = eval qq[\$DEV =~ /^$_[0].*/mg]; my @c2 = eval qq[grep { $_[1] "/dev/\$_" } \@DEV]; ### add this if ($_[1] eq "-c") { my @c = map { /(\S+)$/; $1 } @c1; my %diff; @diff{@c} = (); delete @diff{@c2}; print "!!: $_\n" for keys %diff; exit; } ### my $c1 = scalar @c1; my $c2 = scalar @c2; is($c1, $c2, "ls and $_[1] agreeing on /dev ($c1 $c2)"); };

    and then contemplate on who is right with respect to whether the reported entry is a "character special" file.

      OK, i ran this, exactly same code as you wrote above and got:
      ok 34 - -e ok 35 - -e on unlinked file ok 36 - ls and -b agreeing on /dev (29 29) !!: 0 # Looks like you planned 107 tests but ran 36.

      I dont really uderstand these commands, I only want successfully compile this, so sry, but I must ask what now ?? I can provide this info:

      [tom@alarmpi perl-5.14.2]$ find /dev/ -type c | wc -l 232

        The test runs ls -l /dev 2>/dev/null (which is different from find /dev/ -type c in that it isn't recursive); so check what its output is.

        Or simply print out @c1 in the test, and look for which (presumably fake) entry ends with " 0" and starts with a "c".  (For example, in my case there is a line "total 0" — but as the latter starts with a "t", it doesn't interfere with the test...)

        In other words, my guess would be this is something silly you need not really worry about, provided it's the only test that fails...

Re: Problem compiling Perl 5.14.2 - op/stat.t test 37 failed
by Anonymous Monk on May 31, 2012 at 03:19 UTC

    The first line is "celkem" that means total in english and begins with c. So, please correct it and remove the first line from the test and post a patch please :)

    Well, I haven't checked, but IIRC, you should find $ENV{LANG}='C'; or some such somewhere in the test suite, whose purpose is to nullify any such localizations or error messages

      I checked, it needs one of these :)

      lib/open.t 225 $ENV{LC_ALL} = $ENV{LANG} = 'ru_RU.KOI8-R'; t/op/exec.t 33 $ENV{LC_ALL} = 'C'; # Forge English error messages. t/op/groups.t 10 $ENV{LC_ALL} = "C"; # so that external utilities speak Englis +h t/op/lfs.t 119 $ENV{LC_ALL} = "C";

      Though on my win32/mingw machine ls.exe doesn't seem to respond to LC_ALL or LANG at all, so I can't exactly test this :)

Reaped: Re: Problem compiling Perl 5.14.2 - op/stat.t test 37 failed
by NodeReaper (Curate) on Jun 02, 2012 at 03:15 UTC
Reaped: Re: Problem compiling Perl 5.14.2 - op/stat.t test 37 failed
by NodeReaper (Curate) on Jun 02, 2012 at 13:00 UTC
Re: Problem compiling Perl 5.14.2 - op/stat.t test 37 failed
by Corion (Pope) on Jun 03, 2012 at 10:32 UTC

    Thanks for the report and the fix!

    I've (re-)reported that bug as rt://113472 Perl RT #113472, together with your fix and the other approach outlined by Anonymous Monk making the tools report in English.

    The fix will go into 5.18 and should also go into 5.16.1, or at least a note on this failure will go into 5.16.1.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://973257]
Approved by kcott
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-04-21 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (492 votes), past polls