[svn:parrot] r38139 - trunk/t/codingstd
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Wed Apr 15 23:59:44 UTC 2009
Author: jkeenan
Date: Wed Apr 15 23:59:42 2009
New Revision: 38139
URL: https://trac.parrot.org/parrot/changeset/38139
Log:
Allow for non-testing of files which cannot contain an SVN Id tag. Cf.: https://trac.parrot.org/parrot/ticket/554.
Modified:
trunk/t/codingstd/svn_id.t
Modified: trunk/t/codingstd/svn_id.t
==============================================================================
--- trunk/t/codingstd/svn_id.t Wed Apr 15 23:35:38 2009 (r38138)
+++ trunk/t/codingstd/svn_id.t Wed Apr 15 23:59:42 2009 (r38139)
@@ -4,8 +4,9 @@
use strict;
use warnings;
+use Cwd;
+use File::Spec ();
use lib qw( . lib ../lib ../../lib );
-
use Parrot::Distribution;
use Test::More tests => 1;
@@ -34,22 +35,33 @@
=cut
my $DIST = Parrot::Distribution->new;
+my $cwd = cwd();
+
+# Certain files, for various reasons, cannot have an
+# SVN Id tag. We exclude them from examination by this test.
-my @files = @ARGV ? <@ARGV> : (
- $DIST->get_c_language_files(),
- $DIST->get_make_language_files(),
- $DIST->get_perl_language_files(),
- $DIST->get_pir_language_files(),
+my %known_exceptions = map {
+ $_ => 1,
+ ( File::Spec->catdir( $cwd, $_ ) ) => 1,
+ } qw(
+ examples/pir/quine_ord.pir
+ );
+
+my @files = grep { ! $known_exceptions{$_} }
+ ( @ARGV
+ ? <@ARGV>
+ : map { $_->path } (
+ $DIST->get_c_language_files(),
+ $DIST->get_make_language_files(),
+ $DIST->get_perl_language_files(),
+ $DIST->get_pir_language_files(),
+ )
);
my @no_id_files;
foreach my $file (@files) {
- # if we have command line arguments, the file is the full path
- # otherwise, use the relevant Parrot:: path method
- my $path = @ARGV ? $file : $file->path;
-
- my $buf = $DIST->slurp($path);
+ my $buf = $DIST->slurp($file);
if ( $buf !~ m/\$Id
(?:
@@ -58,7 +70,7 @@
:.*\$ # expanded tag, colon required
)
/xm ) {
- push @no_id_files, $path;
+ push @no_id_files, $file;
next;
}
}
More information about the parrot-commits
mailing list