X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fdist%2Fauthors.t;h=ff7d5e27c9eb306550b534247a65911bb73a4da6;hb=c0329273268971824784f239f32c7246e68da9c5;hp=e5bc2cd9d5a67a513a0d9b48d793eeab54f5f266;hpb=c26b30dee587fa008f7d956b61ae27c36ac7ec82;p=dbsrgits%2FDBIx-Class.git diff --git a/xt/dist/authors.t b/xt/dist/authors.t index e5bc2cd..ff7d5e2 100644 --- a/xt/dist/authors.t +++ b/xt/dist/authors.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; @@ -58,16 +60,29 @@ if (length $ENV{PATH}) { ) =~ /\A(.+)\z/; } -# this may fail - not every system has git -if (my @git_authors = map - { my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname } - qx( git shortlog -e -s ) +# no git-check when smoking a PR +if ( + ( + ! $ENV{TRAVIS_PULL_REQUEST} + or + $ENV{TRAVIS_PULL_REQUEST} eq "false" + ) + and + -d '.git' ) { - for (@git_authors) { + + binmode (Test::More->builder->$_, ':utf8') for qw/output failure_output todo_output/; + + # this may fail - not every system has git + for ( + map + { my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname } + qx( git shortlog -e -s ) + ) { my ($eml) = $_ =~ $email_re; - fail "Commit author '$_' (from git) not reflected in AUTHORS, perhaps a missing .mailmap entry?" - unless $known_authors{$eml}; + ok $known_authors{$eml}, + "Commit author '$_' (from .mailmap-aware `git shortlog -e -s`) reflected in ./AUTHORS"; } }