You should skip that test if your VCS (e.g. git) is not (yet) clean.

Testing the Changes/ChangeLog is something you only want to do just before a release.

It is easy to built that skip into xt/99-changes.t. That is up to the OP. I'd use a module though:

$ cat xt/99-changelog.t #!/usr/bin/perl use strict; use warnings; use Test::More; eval "use Test::CPAN::Changes"; plan skip_all => "Test::CPAN::Changes required for this test" if $@; changes_file_ok ("ChangeLog"); done_testing;

And while at it, also add additional tests:

$ cat xt/50_manifest.t #!/usr/bin/perl use strict; use warnings; use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing MANIFEST" if + $@; manifest_ok (); done_testing;
$ cat xt/40_filenames.t #!/usr/bin/perl use strict; use warnings; use Test::More; eval "use Test::Portability::Files"; plan skip_all => "1..0 # Test::Portability::Files required for these t +ests\n" if $@; BEGIN { $ENV{RELEASE_TESTING} = 1; } options (use_file_find => 0, test_amiga_length => 1, test_mac_length = +> 1); run_tests ();

Of course you need pod checks too and when all that is done, dig into Test::Kwalitee to go next-level.

Good luck and kudo's for trying!

edit: I tracked my ChangeLog check:

sub check_changelog { # Check if the first date has been updated ... my @td = grep m/^Change(?:s|Log)$/i => glob "[Cc]*"; unless (@td) { warn "No ChangeLog to check\n"; return; } my %mnt = qw( jan 1 feb 2 mar 3 apr 4 may 5 jun 6 jul 7 aug 8 sep +9 oct 10 nov 11 dec 12 ); open my $fh, "<", $td[0] or croak "$td[0]: $!\n"; while (<$fh>) { s/\b([0-9]{4}) (?:[- ]) ([0-9]{1,2}) (?:[- ]) ([0-9]{1,2})\b/$3-$2-$1/x; # 2015-01-15 => 15-01-2015 m/\b([0-9]{1,2}) (?:[- ]) ([0-9]{1,2}|[ADFJMNOSadfjmnos][acekopu][abcgilnprtvy]) (?: +[- ]) ([0-9]{4})\b/x or next; my ($d, $m, $y) = ($1 + 0, ($mnt{lc $2} || $2) + 0, $3 + 0); printf STDERR "Most recent ChangeLog entry is dated %02d-%02d- +%04d\n", $d, $m, $y; unless ($ENV{SKIP_CHANGELOG_DATE}) { my @t = localtime; my $D = Delta_Days ($y, $m , $d, $t[5] + 1900, $t[4] + 1, +$t[3]); $D < 0 and croak RED, "Last entry in $td[0] is in the f +uture!", RESET, "\n"; $D > 2 and croak RED, "Last entry in $td[0] is not up t +o date ($D days ago)", RESET, "\n"; $D > 0 and warn YELLOW, "Last entry in $td[0] is not toda +y", RESET, "\n"; } last; } close $fh; } # check_changelog

If you prefer dark themes or no colors at all, you probably want to alter the warning lines.

This check is based on English *only*. Even though I am Dutch, my log entries are English only.

@corion $ENV{SKIP_CHANGELOG_DATE} is set in the calling process if my git is not clean.


Enjoy, Have FUN! H.Merijn

In reply to Re^4: Module Change Log by Tux
in thread Module Change Log by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.