Author: particle
Date: Fri Feb 10 12:16:51 2006
New Revision: 11503
Modified:
trunk/t/distro/file_metadata.t
Log:
#38468: [TODO] modify copyright info in parrot repo
~ add test to ensure Copyright property is assigned to all files in MANIFEST
Modified: trunk/t/distro/file_metadata.t
==============================================================================
--- trunk/t/distro/file_metadata.t (original)
+++ trunk/t/distro/file_metadata.t Fri Feb 10 12:16:51 2006
@@ -32,6 +32,12 @@ NOTE: these tests take a B<LONG> time to
=cut
+
+# get files listed in MANIFEST
+my @manifest_files =
+ sort keys %{maniread( catfile $PConfig{build_dir}, 'MANIFEST' )};
+
+
## all test files have "text/plain" mime-type
TEST_MIME: {
my $test_dir = 't';
@@ -58,18 +64,15 @@ TEST_MIME: {
) for @test_files;
} # TEST_MIME
+
## keyword expansion
KEYWORD_EXP: {
- my @all_files;
-
diag "this may take a while...";
- # get files listed in MANIFEST
- @all_files = sort keys %{maniread( catfile $PConfig{build_dir},
'MANIFEST' )};
-
my @cmd = qw(svn pg svn:mime-type);
- my @plain_files = grep { $_ if qx(@cmd $_) =~ m!text/plain! }
@all_files;
+ my @plain_files =
+ grep { $_ if qx(@cmd $_) =~ m!text/plain! } @manifest_files;
chomp @plain_files;
@cmd = qw(svn pg svn:keywords);
@@ -85,6 +88,34 @@ KEYWORD_EXP: {
} # KEYWORD_EXP
+## Copyright keyword
+COPYRIGHT: {
+ my $readme = catfile( $PConfig{build_dir}, 'README' );
+ open my $IN, '<' => $readme
+ or die qq|can't open $readme: $!|;
+
+ my $official_copyright;
+ while( <$IN> )
+ {
+ next unless m/^Parrot is (Copyright .*)/;
+ $official_copyright = $1;
+ last;
+ }
+ fail('official copyright not found') and last COPYRIGHT
+ unless length $official_copyright;
+
+ my @cmd = qw(svn pg Copyright);
+
+ my $msg = 'Copyright property matches official copyright';
+ diag $msg;
+
+ is(
+ sub{ my $r = qx(@cmd $_); chomp $r; "$_: $r" }->(),
+ "$_: $official_copyright",
+ "$msg ($_)"
+ ) for @manifest_files;
+}
+
# remember to change the number of tests :-)
BEGIN {
unless( $Parrot::Revision::svn_entries or `svk ls .` )