summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-04-13 10:26:00 +0100
committerNicholas Clark <nick@ccl4.org>2009-04-13 10:26:00 +0100
commit6ee4ed10654cdc601734d15a3b6dda2ecdd44527 (patch)
treeea8a60838222d7c595e9782ca0edfef2e3da08b9
parentb871937fe0c9b70c9ade25d15af9e28969ff4a5c (diff)
downloadperl-6ee4ed10654cdc601734d15a3b6dda2ecdd44527.tar.gz
Propagate the upgraded TODO/SKIP parser from ext/B/t/deparse.t
-rw-r--r--t/lib/common.pl25
1 files changed, 14 insertions, 11 deletions
diff --git a/t/lib/common.pl b/t/lib/common.pl
index 36d45f3c99..1544df570e 100644
--- a/t/lib/common.pl
+++ b/t/lib/common.pl
@@ -73,17 +73,20 @@ for (@prgs){
}
my($prog,$expected) = split(/\nEXPECT(?:\n|$)/, $_, 2);
- my ($todo, $todo_reason);
- $todo = $prog =~ s/^#\s*TODO\s*(.*)\n//m and $todo_reason = $1;
- # If the TODO reason starts ? then it's taken as a code snippet to evaluate
- # This provides the flexibility to have conditional TODOs
- if ($todo_reason && $todo_reason =~ s/^\?//) {
- my $temp = eval $todo_reason;
- if ($@) {
- die "# In TODO code reason:\n# $todo_reason\n$@";
+ my %reason;
+ foreach my $what (qw(skip todo)) {
+ $prog =~ s/^#\s*\U$what\E\s*(.*)\n//m and $reason{$what} = $1;
+ # If the SKIP reason starts ? then it's taken as a code snippet to
+ # evaluate. This provides the flexibility to have conditional SKIPs
+ if ($reason{$what} && $reason{$what} =~ s/^\?//) {
+ my $temp = eval $reason{$what};
+ if ($@) {
+ die "# In \U$what\E code reason:\n# $reason{$what}\n$@";
+ }
+ $reason{$what} = $temp;
}
- $todo_reason = $temp;
}
+
if ( $prog =~ /--FILE--/) {
my(@files) = split(/\n--FILE--\s*([^\s\n]*)\s*\n/, $prog) ;
shift @files ;
@@ -184,9 +187,9 @@ for (@prgs){
$ok = $results eq $expected;
}
- print_err_line( $switch, $prog, $expected, $results, $todo ) unless $ok;
+ our $TODO = $reason{todo};
+ print_err_line( $switch, $prog, $expected, $results, $TODO ) unless $ok;
- our $TODO = $todo ? $todo_reason : 0;
ok($ok);
foreach (@temps)