This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
diag.t: Let diag.t be run on specific source files
authorFather Chrysostomos <sprout@cpan.org>
Sun, 17 Nov 2013 14:29:37 +0000 (06:29 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 17 Nov 2013 21:08:59 +0000 (13:08 -0800)
./perl -Ilib t/porting/diag.t regcomp.c

will now run it just on regcomp.c.

t/porting/diag.t

index ef5a11b..146d626 100644 (file)
@@ -17,7 +17,8 @@ plan('no_plan');
 # initially so as to not create new test failures upon the initial
 # creation of this test file.  You probably shouldn't do it again.
 # Just add the documentation instead.
-my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list';
+my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list'
+  and shift;
 
 require 'regen/embed_lib.pl';
 
@@ -177,6 +178,10 @@ my $specialformats =
  join '|', sort { length $b cmp length $a } keys %specialformats;
 my $specialformats_re = qr/%$format_modifiers"\s*($specialformats)(\s*")?/;
 
+if (@ARGV) {
+  check_file($_) for @ARGV;
+  exit;
+}
 open my $fh, '<', 'MANIFEST' or die "Can't open MANIFEST: $!";
 while (my $file = <$fh>) {
     chomp $file;