On 12/16/05, Steve Hay <[EMAIL PROTECTED]> wrote: > The real bummer, though, is that I'm now away until Jan 3rd and I'm > switching my machine off now, so you can't see the fruits of your > efforts in my overnight smokes until next year :-(
If its any help to you guys I built and tested just now on Win32 (VC7+Win2k) and it passes all tests + 2 todo tests. This is at patchlevel 26386 I get warnings on sv.c (i mention this because i saw that sv.c was changed between 26384 and 26386 during the time i was messing about with this): sv.c ..\sv.c(812) : warning C4307: '+' : integral constant overflow ..\sv.c(813) : warning C4146: unary minus operator applied to unsigned type, result still unsigned ..\sv.c(818) : warning C4307: '+' : integral constant overflow ..\sv.c(819) : warning C4146: unary minus operator applied to unsigned type, result still unsigned ..\sv.c(834) : warning C4307: '+' : integral constant overflow ..\sv.c(835) : warning C4146: unary minus operator applied to unsigned type, result still unsigned ..\sv.c(840) : warning C4307: '+' : integral constant overflow ..\sv.c(841) : warning C4146: unary minus operator applied to unsigned type, result still unsigned The todo tests are as follows: op/local.....................................................ok 1/85 unexpectedly succeeded op/pat.......................................................ok 1/1195 unexpectedly succeeded The op/pat one seems to suggest that perl #37038 is resolved. (Patch attached to de-TODO this test). ok 1195 - # TODO assigning to original string should not corrupt match vars ok 1/1195 unexpectedly succeeded The op/local one seems to actually indicate a failure in the logic of test.pl and harness. todo_skip from the harness/builder framework emits 'not ok' for todo_skip, but test.pl emits 'ok', so the harness logic assumes that this is an unexpected success when it is in fact just a skip. Patch is attached. BTW, i dont know if this is the right fix really. It seemed to me that a better patch would be to change the way harness handles directives so it recognizes TODO & SKIP as being a valid directive. Currently the logic is that the first non space sequence following a hash mark is considered the tests directive. So for todo tests its # TODO. I was thinking that maybe this logic could be changed slightly so that directives can be listed. Then harness could tell # TODO & SKIP was both a todo and a skip, and not just read it as a todo. I've attached a patched Test::Harness::Straps and Test::Harness::Point that supports multiple directives, with the presumption that they will be supplied in an & seperated list, that way a test can be TODO and SKIP at the same time. Anyway, with either patch applied the misleading unexpected success message goes away. With all three patches applied, all tests pass with no unexpected successes. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
diff -wur -F'^sub' sync/lib/Test/Harness/Point.pm sync_patched/lib/Test/Harness/Point.pm --- sync/lib/Test/Harness/Point.pm 2005-04-24 17:53:28.000000000 +0200 +++ sync_patched/lib/Test/Harness/Point.pm 2005-12-17 15:18:05.859125000 +0100 @@ -112,15 +112,19 @@ sub set_directive { $directive =~ s/\s+$//; $self->{directive} = $directive; - my ($type,$reason) = ($directive =~ /^\s*(\S+)(?:\s+(.*))?$/); + my ($type,$reason) = ($directive =~ /^\s*([^&\s]+(?:\s*&\s*[^\&\s]+)*)(?:\s+(.*))?$/); $self->set_directive_type( $type ); $reason = "" unless defined $reason; $self->{directive_reason} = $reason; } sub set_directive_type { my $self = shift; - $self->{directive_type} = lc shift; - $self->{type} = $self->{directive_type}; # History + my $type = lc shift; + my %type = map { $_ => 1 } split /\s*&\s*/, $type; + $type = join " & ",sort keys %type; + $self->{directive_types} = \%type; + $self->{directive_type} = $type; + $self->{type} = $type; # History } sub set_directive_reason { my $self = shift; @@ -130,15 +134,18 @@ sub directive_type { my $self = shift; sub type { my $self = shift; $self->{directive_type} } sub directive_reason{ my $self = shift; $self->{directive_reason} } sub reason { my $self = shift; $self->{directive_reason} } +sub is_directive_type { + my $self = shift; + my $type = lc shift; + return $self->{directive_types}{$type}; +} sub is_todo { my $self = shift; - my $type = $self->directive_type; - return $type && ( $type eq 'todo' ); + return $self->is_directive_type('todo'); } sub is_skip { my $self = shift; - my $type = $self->directive_type; - return $type && ( $type eq 'skip' ); + my $type = $self->is_directive_type('skip'); } sub diagnostics { diff -wur -F'^sub' sync/lib/Test/Harness/Straps.pm sync_patched/lib/Test/Harness/Straps.pm --- sync/lib/Test/Harness/Straps.pm 2005-10-10 15:46:04.000000000 +0200 +++ sync_patched/lib/Test/Harness/Straps.pm 2005-12-17 15:06:08.687250000 +0100 @@ -177,7 +177,8 @@ sub _analyze_line { if ( $point->is_todo ) { $totals->{todo}++; - $totals->{bonus}++ if $point->ok; + $totals->{bonus}++ if $point->ok && + !$point->is_skip; } elsif ( $point->is_skip ) { $totals->{skip}++;
diff -wur -F'^sub' sync/t/test.pl sync_patched/t/test.pl --- sync/t/test.pl 2005-09-06 11:13:24.000000000 +0200 +++ sync_patched/t/test.pl 2005-12-17 16:29:33.577875000 +0100 @@ -296,7 +296,7 @@ sub todo_skip { my $n = @_ ? shift : 1; for (1..$n) { - print STDOUT "ok $test # TODO & SKIP: $why\n"; + print STDOUT "not ok $test # TODO & SKIP: $why\n"; $test++; } local $^W = 0;
--- sync\t\op\pat.t 2005-12-05 16:42:34.000000000 +0100 +++ sync_patched\t\op\pat.t 2005-12-17 16:39:34.702875000 +0100 @@ -3420,7 +3420,7 @@ sub func ($) { $s = $1; $s = $2; ok($s eq 'cd', - "# TODO assigning to original string should not corrupt match vars"); + "# assigning to original string should not corrupt match vars"); } # last test 1195