develooper Front page | perl.perl5.porters | Postings from September 2012

[PATCH] Re: [perl #114312] perl 5.17.2 test/install failure on OSX in op/stat.t

Thread Next
Karen Etheridge
September 1, 2012 11:03
[PATCH] Re: [perl #114312] perl 5.17.2 test/install failure on OSX in op/stat.t
Message ID:

    [ether@tequila build/perl-5.16.1].4$; pwd

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

From inspection of the contents of @c1 and @c2 in these tests, I see that @c2 is missing an entry for 'stderr'.

What is happening is that $DEV is not being properly filtered for stderr, as per this comment (t/op/stat.t line 262):

    # /dev/stdout might be either character special or a named pipe,
    # or a symlink, or a socket, depending on which OS and how are
    # you running the test, so let's censor that one away.
    # Similar remarks hold for stderr.

And this is all because the s/// statements are not matching, because the 'ls'
output is colorized.  Unsetting $CLICOLOR and/or $CLICOLOR_FORCE in the shell
makes the test pass.

I have prepared a patch, attached, and also included below.

(I would also suggest this patch be back-ported to all previous versions that
are currently being maintained.)

    commit 2b16a86af77d28d216ac447f3e719fd868ed03c2
    Author: Karen Etheridge <>
    Date:   Sat Sep 1 10:26:37 2012 -0700

        RT#114312: prevent ls from colourizing output
        ANSI colour codes in the `ls -l /dev` output was preventing some substitutions
        from matching, causing a subsequent test to fail when 'stdout' or 'stderr' was
        not properly removed from $DEV.

    diff --git a/t/op/stat.t b/t/op/stat.t
    index 89411c7..f52f26c 100644
    --- a/t/op/stat.t
    +++ b/t/op/stat.t
    @@ -252,6 +252,7 @@ SKIP: {
         skip "ls command not available to Perl in OpenVMS right now.", 6
           if $Is_VMS;
    +    delete $ENV{CLICOLOR_FORCE};
         my $LS  = $Config{d_readlink} ? "ls -lL" : "ls -l";
         my $CMD = "$LS /dev 2>/dev/null";
         my $DEV = qx($CMD);

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About