From: Smylers Date: Fri, 6 Sep 2013 10:56:07 +0000 (+0100) Subject: Added release manager test for copyright year X-Git-Tag: upstream/5.20.0~1933 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52d097d99176412041811ec3c8c663e4a912d2c7;p=platform%2Fupstream%2Fperl.git Added release manager test for copyright year --- diff --git a/Porting/release_managers_guide.pod b/Porting/release_managers_guide.pod index e900f9c..4c7297f 100644 --- a/Porting/release_managers_guide.pod +++ b/Porting/release_managers_guide.pod @@ -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 diff --git a/t/porting/copyright.t b/t/porting/copyright.t index e1b7faa..c95286d 100644 --- a/t/porting/copyright.t +++ b/t/porting/copyright.t @@ -12,6 +12,10 @@ C 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 @@ -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;