Skip to content

Commit

Permalink
Added release manager test for copyright year
Browse files Browse the repository at this point in the history
  • Loading branch information
Smylers authored and Father Chrysostomos committed Sep 10, 2013
1 parent acc70a0 commit 52d097d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Porting/release_managers_guide.pod
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,16 @@ release, this would be 5.13.11).
For BLEAD-POINT releases, it needs to refer to the previous BLEAD-POINT
release (so for 5.15.3 this would be 5.15.2).

=head3 Check copyright years

Check that the copyright years are up to date by running:

$ ./perl t/porting/copyright.t --now

Remedy any test failures by editing README or perl.c accordingly (search for
the "Copyright"). If updating perl.c, check if the file's own copyright date in
the C comment at the top needs updating, as well as the one printed by C<-v>.

=head3 Check more build configurations

Try running the full test suite against multiple Perl configurations. Here are
Expand Down
22 changes: 21 additions & 1 deletion t/porting/copyright.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ C<perl -v> output match each other.
If the test fails, update at least one of README and perl.c so that they match
reality.
Optionally you can pass the C<--now> option to check they are at the current
year. This isn't checked by default, so that it doesn't fail for people
working on older releases. It should be run before making a new release.
=cut


Expand All @@ -20,9 +24,25 @@ use strict;
BEGIN { require 'test.pl' }


my ($opt) = @ARGV;

my $readme_year = readme_year();
my $v_year = v_year();
is $readme_year, $v_year, 'README and perl -v copyright dates match';

# Check that both copyright dates are up-to-date, but only if requested, so
# that tests still pass for people intentionally working on older versions:
if ($opt eq '--now')
{
my $current_year = (gmtime)[5] + 1900;
is $v_year, $current_year, 'perl -v copyright includes current year';
is $readme_year, $current_year, 'README copyright includes current year';
}

# Otherwise simply check that the two copyright dates match each other:
else
{
is $readme_year, $v_year, 'README and perl -v copyright dates match';
}

done_testing;

Expand Down

0 comments on commit 52d097d

Please sign in to comment.