2 # Copyright (C) 2007-2009, Parrot Foundation.
8 use File::Spec::Functions;
9 use lib qw( . lib ../lib ../../lib );
10 use Parrot::Distribution;
11 use Test::More tests => 1;
15 t/codingstd/svn_id.t - checks for an svn Id keyword line in parrot source files
20 % prove t/codingstd/svn_id.t
23 % perl t/codingstd/svn_id.t src/foo.c include/parrot/bar.h
27 Makes sure that the Subversion (svn) Id keyword line (that which gets
28 expanded to show filename, last modification date and last author
29 information) exists within Parrot source files.
33 L<docs/pdds/pdd07_codingstd.pod>
37 my $DIST = Parrot::Distribution->new;
38 my $cwd = getcwd(); # cwd() has some bugs when parent directory is a symbolic link
40 # Certain files, for various reasons, cannot have an
41 # SVN Id tag. We exclude them from examination by this test.
43 my %known_exceptions = map {
45 ( catdir( $cwd, $_ ) ) => 1,
47 catfile(qw/ examples pir quine_ord.pir/),
48 catfile(qw/ examples streams FileLines.pir/),
49 catfile(qw/ examples streams ParrotIO.pir/),
52 my @files = grep { ! $known_exceptions{$_} }
56 $DIST->get_c_language_files(),
57 $DIST->get_make_language_files(),
58 $DIST->get_perl_language_files(),
59 $DIST->get_pir_language_files(),
65 foreach my $file (@files) {
67 my $buf = $DIST->slurp($file);
71 \$ # unexpanded tag, for git-svn users or for new files
73 :.*\$ # expanded tag, colon required
76 push @no_id_files, $file;
82 ok( !scalar(@no_id_files), 'Id keyword line exists' )
85 $/ => "No Id keyword line found in " . scalar @no_id_files . " files:",
91 # cperl-indent-level: 4
94 # vim: expandtab shiftwidth=4: