From: Peter Rabbitson Date: Thu, 26 Feb 2015 18:22:22 +0000 (+0100) Subject: Factor out author count anouncement, making it seen on plain installs X-Git-Tag: v0.082820~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2bc8e9816f4e6985778d6f2ea27c936f80d0e48c;p=dbsrgits%2FDBIx-Class.git Factor out author count anouncement, making it seen on plain installs (cherry pick of 245e3f5d) --- diff --git a/t/zzzzzzz_authors.t b/t/zzzzzzz_authors.t new file mode 100644 index 0000000..ce9a217 --- /dev/null +++ b/t/zzzzzzz_authors.t @@ -0,0 +1,15 @@ +use warnings; +use strict; + +use Test::More 'no_plan'; + +my $authorcount = scalar do { + open (my $fh, '<', 'AUTHORS') or die "Unable to open AUTHORS - can't happen: $!\n"; + map { chomp; ( ( ! $_ or $_ =~ /^\s*\#/ ) ? () : $_ ) } <$fh>; +} or die "Known AUTHORS file seems empty... can't happen..."; + +# do not announce anything under travis - we are watching for STDERR silence +diag "\n\n$authorcount contributors made this library what it is today\n\n" + unless ($ENV{TRAVIS}||'') eq 'true'; + +ok 1; diff --git a/xt/authors.t b/xt/authors.t index 48e693f..e5bc2cd 100644 --- a/xt/authors.t +++ b/xt/authors.t @@ -38,27 +38,18 @@ is_deeply ( my $email_re = qr/( \< [^\<\>]+ \> ) $/x; -my (%known_authors, $count); +my %known_authors; for (@known_authors) { my ($name_email) = m/ ^ (?: [^\:]+ \: \s )? (.+) /x; my ($email) = $name_email =~ $email_re; - if ( + fail "Duplicate found: $name_email" if ( $known_authors{$name_email}++ or ( $email and $known_authors{$email}++ ) - ) { - fail "Duplicate found: $name_email"; - } - else { - $count++; - } + ); } -# do not announce anything under travis - we are watching for STDERR silence -diag "\n\n$count contributors made this library what it is today\n\n" - unless ($ENV{TRAVIS}||'') eq 'true'; - # augh taint mode if (length $ENV{PATH}) { ( $ENV{PATH} ) = join ( $Config{path_sep},