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

Re: [perl #99972] re/regexp.t failures on ubuntu 11.04

Thread Previous
From:
Nicholas Clark
Date:
September 28, 2011 07:41
Subject:
Re: [perl #99972] re/regexp.t failures on ubuntu 11.04
Message ID:
20110928144117.GG23881@plum.flirble.org
On Sun, Sep 25, 2011 at 03:34:34PM -0700, Robin Barker wrote:

> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> I upgraded my ubuntu to 11.04 and started have compilation 
> and test failures.  With the supplied gcc-4.5.2 I reduced
> the problems to re/regexp failures.
> 
> Failed 6 tests out of 2044, 99.71% okay.
> 	re/regexp.t
> 	re/regexp_noamp.t
> 	re/regexp_notrie.t
> 	re/regexp_qr.t
> 	re/regexp_qr_embed.t
> 	re/regexp_trielist.t
> 
> This is the same test failure: each regexp_*.t test calls regexp.t
> 
> The tests pass with C<(cd t; ./perl harness re/*.t) but
> > ./perl -Ilib t/re/regexp.t
> # RT #89774
> not ok 1539 # TODO () /s\xDF/ui:\xDFs:yT:$&:\xDFs => `T', match=
> $subject = "\337s";
> 
> $got = "T";
> 
>                 ;
>                 $match = ($subject =~ m/s\xDF/ui) while $c--;
>                 $got = "$&";
> 
> 
> Before upgrading to ubuntu 11.04, I had no test failues, using gcc-4.6.0
> After upgrading, gcc-4.6.0 would not compile perl: missing asm/errno.h

> Summary of my perl5 (revision 5 version 15 subversion 3) configuration:
>   Commit id: 9c8c35062b12e41237396ffd50b944586cbce3bf

I can't work out what version this actually is.

$ git show 9c8c35062b12e41237396ffd50b944586cbce3bf
fatal: bad object 9c8c35062b12e41237396ffd50b944586cbce3bf


The above description looks suspiciously like the problem solved by
Karl Williamson in:

commit 1b7228c9af61f2feb164874a11b82557fc988b5f
Author: Karl Williamson <public@khwilliamson.com>
Date:   Thu Sep 22 17:34:35 2011 -0600

    regexp.t: print diagnostics with leading '#'
    
    Some test platforms don't like unexpected output without the comment
    prefix character

diff --git a/t/re/regexp.t b/t/re/regexp.t
index 9c430ad..815b877 100644
--- a/t/re/regexp.t
+++ b/t/re/regexp.t
@@ -59,6 +59,11 @@ BEGIN {
 
 }
 
+sub _comment {
+    return map { /^#/ ? "$_\n" : "# $_\n" }
+           map { split /\n/ } @_;
+}
+
 use strict;
 use warnings FATAL=>"all";
 use vars qw($iters $numtests $bang $ffff $nulnul $OP);
@@ -175,7 +180,7 @@ EOFCODE
 	    next TEST;
 	}
 	elsif ($@) {
-	    print "not ok $test$todo $input => error `$err'\n$code\n$@\n"; next TEST;
+	    print "not ok $test$todo $input => error `$err'\n", _comment("$code\n$@\n"); next TEST;
 	}
 	elsif ($result =~ /^n/) {
 	    if ($match) { print "not ok $test$todo ($study) $input => false positive\n"; next TEST }
@@ -184,12 +189,12 @@ EOFCODE
 	    if (!$match || $got ne $expect) {
 	        eval { require Data::Dumper };
 		if ($@) {
-		    print "not ok $test$todo ($study) $input => `$got', match=$match\n$code\n";
+		    print "not ok $test$todo ($study) $input => `$got', match=$match\n", _comment("$code\n");
 		}
 		else { # better diagnostics
 		    my $s = Data::Dumper->new([$subject],['subject'])->Useqq(1)->Dump;
 		    my $g = Data::Dumper->new([$got],['got'])->Useqq(1)->Dump;
-		    print "not ok $test$todo ($study) $input => `$got', match=$match\n$s\n$g\n$code\n";
+		    print "not ok $test$todo ($study) $input => `$got', match=$match\n", _comment("$s\n$g\n$code\n");
 		}
 		next TEST;
 	    }



But I'm confused as that was 3 days before the date of your bug report.

Nicholas Clark

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About