From f008f53b0874b02cab7afb0241a91795650faa93 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 5 Jul 2011 14:09:28 +0200 Subject: [PATCH] In cmp_version.t, show in the TAP when we are skipping a particular version. The facility to skip specific versions of modules was added in a5a2efce1e0ae6b7. However, it gave no indication when such an exception caused a skip, because it generated identical TAP output to the normal pass case. Instead, we now show the diffs (as for the "not ok" TAP output), but generate TAP "SKIP" for the pass. This makes it clear what is happening. --- Porting/cmpVERSION.pl | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl index 92cfec9..5dadcf5 100755 --- a/Porting/cmpVERSION.pl +++ b/Porting/cmpVERSION.pl @@ -77,14 +77,10 @@ my %skip; # Files to skip just for particular version(s), # usually due to some # mix-up -my %skip_versions; -if ($tap) { - %skip_versions - = ( +my %skip_versions = ( # 'some/sample/file.pm' => [ '1.23', '1.24' ], 'dist/threads/lib/threads.pm' => [ '1.83' ], ); -} my $skip_dirs = qr|^t/lib|; @@ -154,8 +150,6 @@ foreach my $pm_file (sort keys %module_diffs) { if ((!defined $pm_version || !defined $orig_pm_version) || ($pm_version eq 'undef' || $orig_pm_version eq 'undef') # sigh || ($pm_version ne $orig_pm_version) # good - || (exists $skip_versions{$pm_file} - and grep $pm_version eq $_, @{$skip_versions{$pm_file}}) ) { printf "ok %d - %s\n", ++$count, $pm_file if $tap; } else { @@ -163,7 +157,12 @@ foreach my $pm_file (sort keys %module_diffs) { foreach (sort @{$module_diffs{$pm_file}}) { print "# $_" for `$diff_cmd '$_'`; } - printf "not ok %d - %s\n", ++$count, $pm_file; + if (exists $skip_versions{$pm_file} + and grep $pm_version eq $_, @{$skip_versions{$pm_file}}) { + printf "ok %d - SKIP $pm_file version $pm_version\n", ++$count; + } else { + printf "not ok %d - %s\n", ++$count, $pm_file; + } } else { push @diff, @{$module_diffs{$pm_file}}; print "$pm_file\n"; -- 1.8.3.1