summaryrefslogtreecommitdiff
path: root/cpan/Term-ANSIColor
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-05-28 16:38:12 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-05-28 17:04:56 +0100
commit5e64492f6452260c13875425441f9127e716df7b (patch)
tree0ab5c332f2126fb2bd0ea0dba957575a474698f4 /cpan/Term-ANSIColor
parent958bf2239ef31fb4df8ca5ec2036429602b134a5 (diff)
downloadperl-5e64492f6452260c13875425441f9127e716df7b.tar.gz
Update Term-ANSIColor to CPAN version 4.03
[DELTA] Term::ANSIColor 4.03 (2014-03-23) Switch the module build system to Module::Build, but still generate a Makefile.PL file for backward compatibility and for the use of Perl core. Fix typo in SYNOPSIS (colorstrip example) and duplicated word. Thanks, Olivier Mengué and David Steinbrunner. (#85480, #94006) Skip POD and some other style tests unless doing automated or release testing. Skip POD spelling, coverage, and Perl::Critic tests unless doing author testing. Use the Lancaster Consensus environment variables instead of RRA_MAINTAINER_TESTS. (#93474) Add SEE ALSO reference to Win32::Console::ANSI. (#87295)
Diffstat (limited to 'cpan/Term-ANSIColor')
-rw-r--r--cpan/Term-ANSIColor/lib/Term/ANSIColor.pm (renamed from cpan/Term-ANSIColor/ANSIColor.pm)137
-rw-r--r--cpan/Term-ANSIColor/t/lib/Test/RRA.pm260
-rw-r--r--cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm218
-rwxr-xr-x[-rw-r--r--]cpan/Term-ANSIColor/t/module/aliases-func.t (renamed from cpan/Term-ANSIColor/t/aliases-func.t)2
-rwxr-xr-x[-rw-r--r--]cpan/Term-ANSIColor/t/module/basic.t (renamed from cpan/Term-ANSIColor/t/basic.t)5
-rwxr-xr-x[-rw-r--r--]cpan/Term-ANSIColor/t/module/basic256.t (renamed from cpan/Term-ANSIColor/t/basic256.t)2
-rwxr-xr-x[-rw-r--r--]cpan/Term-ANSIColor/t/module/eval.t (renamed from cpan/Term-ANSIColor/t/eval.t)28
-rwxr-xr-x[-rw-r--r--]cpan/Term-ANSIColor/t/module/stringify.t (renamed from cpan/Term-ANSIColor/t/stringify.t)5
-rwxr-xr-x[-rw-r--r--]cpan/Term-ANSIColor/t/taint/basic.t (renamed from cpan/Term-ANSIColor/t/taint.t)2
9 files changed, 579 insertions, 80 deletions
diff --git a/cpan/Term-ANSIColor/ANSIColor.pm b/cpan/Term-ANSIColor/lib/Term/ANSIColor.pm
index 1718366660..2101a87125 100644
--- a/cpan/Term-ANSIColor/ANSIColor.pm
+++ b/cpan/Term-ANSIColor/lib/Term/ANSIColor.pm
@@ -1,7 +1,7 @@
# Term::ANSIColor -- Color screen output using ANSI escape sequences.
#
# Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005, 2006, 2008, 2009, 2010,
-# 2011, 2012, 2013 Russ Allbery <rra@stanford.edu>
+# 2011, 2012, 2013, 2014 Russ Allbery <rra@cpan.org>
# Copyright 1996 Zenin
# Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com>
#
@@ -40,7 +40,7 @@ our $AUTOLOAD;
# against circular module loading (not that we load any modules, but
# consistency is good).
BEGIN {
- $VERSION = '4.02';
+ $VERSION = '4.03';
# All of the basic supported constants, used in %EXPORT_TAGS.
my @colorlist = qw(
@@ -60,14 +60,13 @@ BEGIN {
);
# 256-color constants, used in %EXPORT_TAGS.
- ## no critic (ValuesAndExpressions::ProhibitMagicNumbers)
my @colorlist256 = (
(map { ("ANSI$_", "ON_ANSI$_") } 0 .. 15),
(map { ("GREY$_", "ON_GREY$_") } 0 .. 23),
);
for my $r (0 .. 5) {
for my $g (0 .. 5) {
- push @colorlist256, map { ("RGB$r$g$_", "ON_RGB$r$g$_") } 0 .. 5;
+ push(@colorlist256, map { ("RGB$r$g$_", "ON_RGB$r$g$_") } 0 .. 5);
}
}
@@ -144,7 +143,6 @@ our %ATTRIBUTES = (
# Generating the 256-color codes involves a lot of codes and offsets that are
# not helped by turning them into constants.
-## no critic (ValuesAndExpressions::ProhibitMagicNumbers)
# The first 16 256-color codes are duplicates of the 16 ANSI colors,
# included for completeness.
@@ -172,8 +170,6 @@ for my $n (0 .. 23) {
$ATTRIBUTES{"on_grey$n"} = "48;5;$code";
}
-## use critic (ValuesAndExpressions::ProhibitMagicNumbers)
-
# Reverse lookup. Alphabetically first name for a sequence is preferred.
our %ATTRIBUTES_R;
for my $attr (reverse sort keys %ATTRIBUTES) {
@@ -244,14 +240,14 @@ sub AUTOLOAD {
# Check if we were called with something that doesn't look like an
# attribute.
- if (!$attr || !defined $ATTRIBUTES{ lc $attr }) {
+ if (!($attr && defined($ATTRIBUTES{ lc $attr }))) {
croak("undefined subroutine &$AUTOLOAD called");
}
# If colors are disabled, just return the input. Do this without
# installing a sub for (marginal, unbenchmarked) speed.
if ($ENV{ANSI_COLORS_DISABLED}) {
- return join q{}, @_;
+ return join(q{}, @_);
}
# We've untainted the name of the sub.
@@ -273,13 +269,13 @@ sub AUTOLOAD {
my $eval_result = eval qq{
sub $AUTOLOAD {
if (\$ENV{ANSI_COLORS_DISABLED}) {
- return join q{}, \@_;
+ return join(q{}, \@_);
} elsif (\$AUTOLOCAL && \@_) {
return PUSHCOLOR('$escape') . join(q{}, \@_) . POPCOLOR;
} elsif (\$AUTORESET && \@_) {
return '$escape' . join(q{}, \@_) . "\e[0m";
} else {
- return '$escape' . join q{}, \@_;
+ return '$escape' . join(q{}, \@_);
}
}
1;
@@ -309,7 +305,7 @@ sub AUTOLOAD {
# Returns: The text passed in
sub PUSHCOLOR {
my (@text) = @_;
- my $text = join q{}, @text;
+ my $text = join(q{}, @text);
# Extract any number of color-setting escape sequences from the start of
# the string.
@@ -324,7 +320,7 @@ sub PUSHCOLOR {
}
# Push the color onto the stack.
- push @COLORSTACK, $color;
+ push(@COLORSTACK, $color);
return $text;
}
@@ -336,9 +332,9 @@ sub PUSHCOLOR {
# Returns: The concatenation of @text prepended with the new stack color
sub POPCOLOR {
my (@text) = @_;
- pop @COLORSTACK;
+ pop(@COLORSTACK);
if (@COLORSTACK) {
- return $COLORSTACK[-1] . join q{}, @text;
+ return $COLORSTACK[-1] . join(q{}, @text);
} else {
return RESET(@text);
}
@@ -353,7 +349,7 @@ sub POPCOLOR {
# Returns: The concatenation of the text and the proper color reset sequence.
sub LOCALCOLOR {
my (@text) = @_;
- return PUSHCOLOR(join q{}, @text) . POPCOLOR();
+ return PUSHCOLOR(join(q{}, @text)) . POPCOLOR();
}
##############################################################################
@@ -379,10 +375,10 @@ sub color {
# Build the attribute string from semicolon-separated numbers.
my $attribute = q{};
for my $code (@codes) {
- $code = lc $code;
- if (defined $ATTRIBUTES{$code}) {
+ $code = lc($code);
+ if (defined($ATTRIBUTES{$code})) {
$attribute .= $ATTRIBUTES{$code} . q{;};
- } elsif (defined $ALIASES{$code}) {
+ } elsif (defined($ALIASES{$code})) {
$attribute .= $ALIASES{$code} . q{;};
} else {
croak("Invalid attribute name $code");
@@ -390,7 +386,7 @@ sub color {
}
# We added one too many semicolons for simplicity. Remove the last one.
- chop $attribute;
+ chop($attribute);
# Return undef if there were no attributes.
return ($attribute ne q{}) ? "\e[${attribute}m" : undef;
@@ -416,12 +412,12 @@ sub uncolor {
$escape =~ s{ \A \e\[ }{}xms;
$escape =~ s{ m \z } {}xms;
my ($attrs) = $escape =~ m{ \A ((?:\d+;)* \d*) \z }xms;
- if (!defined $attrs) {
+ if (!defined($attrs)) {
croak("Bad escape sequence $escape");
}
# Pull off 256-color codes (38;5;n or 48;5;n) as a unit.
- push @nums, $attrs =~ m{ ( 0*[34]8;0*5;\d+ | \d+ ) (?: ; | \z ) }xmsg;
+ push(@nums, $attrs =~ m{ ( 0*[34]8;0*5;\d+ | \d+ ) (?: ; | \z ) }xmsg);
}
# Now, walk the list of numbers and convert them to attribute names.
@@ -430,10 +426,10 @@ sub uncolor {
for my $num (@nums) {
$num =~ s{ ( \A | ; ) 0+ (\d) }{$1$2}xmsg;
my $name = $ATTRIBUTES_R{$num};
- if (!defined $name) {
+ if (!defined($name)) {
croak("No name for escape sequence $num");
}
- push @result, $name;
+ push(@result, $name);
}
# Return the attribute names.
@@ -461,7 +457,7 @@ sub colored {
my ($string, @codes);
if (ref($first) && ref($first) eq 'ARRAY') {
@codes = @{$first};
- $string = join q{}, @rest;
+ $string = join(q{}, @rest);
} else {
$string = $first;
@codes = @rest;
@@ -477,11 +473,11 @@ sub colored {
# If $EACHLINE is defined, split the string on line boundaries, suppress
# empty segments, and then colorize each of the line sections.
- if (defined $EACHLINE) {
+ if (defined($EACHLINE)) {
my @text = map { ($_ ne $EACHLINE) ? $attr . $_ . "\e[0m" : $_ }
grep { length($_) > 0 }
- split m{ (\Q$EACHLINE\E) }xms, $string;
- return join q{}, @text;
+ split(m{ (\Q$EACHLINE\E) }xms, $string);
+ return join(q{}, @text);
} else {
return $attr . $string . "\e[0m";
}
@@ -498,7 +494,7 @@ sub colored {
# standard color name as an alias, or an unknown standard color name
sub coloralias {
my ($alias, $color) = @_;
- if (!defined $color) {
+ if (!defined($color)) {
if (!exists $ALIASES{$alias}) {
return;
} else {
@@ -529,7 +525,7 @@ sub colorstrip {
for my $string (@string) {
$string =~ s{ \e\[ [\d;]* m }{}xmsg;
}
- return wantarray ? @string : join q{}, @string;
+ return wantarray ? @string : join(q{}, @string);
}
# Given a list of color attributes (arguments for color, for instance), return
@@ -540,9 +536,9 @@ sub colorstrip {
# Returns: True if all the attributes are valid, false otherwise.
sub colorvalid {
my (@codes) = @_;
- @codes = map { split q{ }, lc $_ } @codes;
+ @codes = map { split(q{ }, lc($_)) } @codes;
for my $code (@codes) {
- if (!defined $ATTRIBUTES{$code} && !defined $ALIASES{$code}) {
+ if (!defined($ATTRIBUTES{$code}) && !defined($ALIASES{$code})) {
return;
}
}
@@ -562,24 +558,25 @@ __END__
Term::ANSIColor - Color screen output using ANSI escape sequences
=for stopwords
-cyan colorize namespace runtime TMTOWTDI cmd.exe 4nt.exe command.com NT
-ESC Delvare SSH OpenSSH aixterm ECMA-048 Fraktur overlining Zenin
-reimplemented Allbery PUSHCOLOR POPCOLOR LOCALCOLOR openmethods.com
-grey ATTR urxvt mistyped prepending Bareword filehandle Cygwin Starsinic
-aterm rxvt CPAN RGB Solarized Whitespace alphanumerics undef
+cyan colorize namespace runtime TMTOWTDI cmd.exe cmd.exe. 4nt.exe. 4nt.exe
+command.com NT ESC Delvare SSH OpenSSH aixterm ECMA-048 Fraktur overlining
+Zenin reimplemented Allbery PUSHCOLOR POPCOLOR LOCALCOLOR openmethods.com
+openmethods.com. grey ATTR urxvt mistyped prepending Bareword filehandle
+Cygwin Starsinic aterm rxvt CPAN RGB Solarized Whitespace alphanumerics
+undef
=head1 SYNOPSIS
use Term::ANSIColor;
- print color 'bold blue';
+ print color('bold blue');
print "This text is bold blue.\n";
- print color 'reset';
+ print color('reset');
print "This text is normal.\n";
print colored("Yellow on magenta.", 'yellow on_magenta'), "\n";
print "This text is normal.\n";
- print colored ['yellow on_magenta'], 'Yellow on magenta.', "\n";
- print colored ['red on_bright_yellow'], 'Red on bright yellow.', "\n";
- print colored ['bright_red on_black'], 'Bright red on black.', "\n";
+ print colored(['yellow on_magenta'], 'Yellow on magenta.', "\n");
+ print colored(['red on_bright_yellow'], 'Red on bright yellow.', "\n");
+ print colored(['bright_red on_black'], 'Bright red on black.', "\n");
print "\n";
# Map escape sequences back to color names.
@@ -589,7 +586,7 @@ aterm rxvt CPAN RGB Solarized Whitespace alphanumerics undef
# Strip all color escape sequences.
use Term::ANSIColor 2.01 qw(colorstrip);
- print colorstrip '\e[1mThis is bold\e[0m', "\n";
+ print colorstrip("\e[1mThis is bold\e[0m"), "\n";
# Determine whether a color is valid.
use Term::ANSIColor 2.02 qw(colorvalid);
@@ -729,7 +726,7 @@ C<rgb000> or C<rgb515>. Similarly, the recognized background colors are:
on_ansi0 .. on_ansi15
on_grey0 .. on_grey23
-plus C<on_rgbI<RGB>> for for I<R>, I<G>, and I<B> values from 0 to 5.
+plus C<on_rgbI<RGB>> for I<R>, I<G>, and I<B> values from 0 to 5.
For any of the above listed attributes, case is not significant.
@@ -1092,11 +1089,11 @@ Support for italic was added in Term::ANSIColor 3.02, included in Perl
Support for colors 16 through 256 (the C<ansi>, C<rgb>, and C<grey>
colors), the C<:constants256> import tag, the coloralias() function, and
support for the ANSI_COLORS_ALIASES environment variable were added in
-Term::ANSIColor 4.00.
+Term::ANSIColor 4.00, included in Perl 5.17.8.
$Term::ANSIColor::AUTOLOCAL was changed to take precedence over
$Term::ANSIColor::AUTORESET, rather than the other way around, in
-Term::ANSIColor 4.00.
+Term::ANSIColor 4.00, included in Perl 5.17.8.
=head1 RESTRICTIONS
@@ -1181,8 +1178,31 @@ supported by this module.
Most modern X terminal emulators support 256 colors. Known to not support
those colors are aterm, rxvt, Terminal.app, and TTY/VC.
+=head1 AUTHORS
+
+Original idea (using constants) by Zenin, reimplemented using subs by Russ
+Allbery <rra@cpan.org>, and then combined with the original idea by
+Russ with input from Zenin. 256-color support is based on work by Kurt
+Starsinic. Russ Allbery now maintains this module.
+
+PUSHCOLOR, POPCOLOR, and LOCALCOLOR were contributed by openmethods.com
+voice solutions.
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 1996 Zenin. Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005,
+2006, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Russ Allbery
+<rra@cpan.org>. Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com>.
+This program is free software; you may redistribute it and/or modify it
+under the same terms as Perl itself.
+
=head1 SEE ALSO
+The CPAN module L<Term::ExtendedColor> provides a different and more
+comprehensive interface for 256-color emulators that may be more
+convenient. The CPAN module L<Win32::Console::ANSI> provides ANSI color
+(and other escape sequence) support in the Win32 Console environment.
+
ECMA-048 is available on-line (at least at the time of this writing) at
L<http://www.ecma-international.org/publications/standards/Ecma-048.htm>.
@@ -1192,32 +1212,11 @@ ECMA-048 and the latter is available for free, there seems little reason
to obtain the ISO standard.
The 256-color control sequences are documented at
-L<http://www.xfree86.org/current/ctlseqs.html> (search for 256-color).
-
-The CPAN module Term::ExtendedColor provides a different and more
-comprehensive interface for 256-color emulators that may be more
-convenient.
+L<http://invisible-island.net/xterm/ctlseqs/ctlseqs.html> (search for
+256-color).
The current version of this module is always available from its web site
at L<http://www.eyrie.org/~eagle/software/ansicolor/>. It is also part of
the Perl core distribution as of 5.6.0.
-=head1 AUTHORS
-
-Original idea (using constants) by Zenin, reimplemented using subs by Russ
-Allbery <rra@stanford.edu>, and then combined with the original idea by
-Russ with input from Zenin. 256-color support is based on work by Kurt
-Starsinic. Russ Allbery now maintains this module.
-
-PUSHCOLOR, POPCOLOR, and LOCALCOLOR were contributed by openmethods.com
-voice solutions.
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 1996 Zenin. Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005,
-2006, 2008, 2009, 2010, 2011, 2012 Russ Allbery <rra@stanford.edu>.
-Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com>. This program is
-free software; you may redistribute it and/or modify it under the same
-terms as Perl itself.
-
=cut
diff --git a/cpan/Term-ANSIColor/t/lib/Test/RRA.pm b/cpan/Term-ANSIColor/t/lib/Test/RRA.pm
new file mode 100644
index 0000000000..12be88bcab
--- /dev/null
+++ b/cpan/Term-ANSIColor/t/lib/Test/RRA.pm
@@ -0,0 +1,260 @@
+# Helper functions for test programs written in Perl.
+#
+# This module provides a collection of helper functions used by test programs
+# written in Perl. This is a general collection of functions that can be used
+# by both C packages with Automake and by stand-alone Perl modules. See
+# Test::RRA::Automake for additional functions specifically for C Automake
+# distributions.
+#
+# The canonical version of this file is maintained in the rra-c-util package,
+# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+#
+# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2013, 2014
+# The Board of Trustees of the Leland Stanford Junior University
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+package Test::RRA;
+
+use 5.006;
+use strict;
+use warnings;
+
+use Exporter;
+use Test::More;
+
+# For Perl 5.006 compatibility.
+## no critic (ClassHierarchies::ProhibitExplicitISA)
+
+# Declare variables that should be set in BEGIN for robustness.
+our (@EXPORT_OK, @ISA, $VERSION);
+
+# Set $VERSION and everything export-related in a BEGIN block for robustness
+# against circular module loading (not that we load any modules, but
+# consistency is good).
+BEGIN {
+ @ISA = qw(Exporter);
+ @EXPORT_OK = qw(skip_unless_author skip_unless_automated use_prereq);
+
+ # This version should match the corresponding rra-c-util release, but with
+ # two digits for the minor version, including a leading zero if necessary,
+ # so that it will sort properly.
+ $VERSION = '5.04';
+}
+
+# Skip this test unless author tests are requested. Takes a short description
+# of what tests this script would perform, which is used in the skip message.
+# Calls plan skip_all, which will terminate the program.
+#
+# $description - Short description of the tests
+#
+# Returns: undef
+sub skip_unless_author {
+ my ($description) = @_;
+ if (!$ENV{AUTHOR_TESTING}) {
+ plan skip_all => "$description only run for author";
+ }
+ return;
+}
+
+# Skip this test unless doing automated testing or release testing. This is
+# used for tests that should be run by CPAN smoke testing or during releases,
+# but not for manual installs by end users. Takes a short description of what
+# tests this script would perform, which is used in the skip message. Calls
+# plan skip_all, which will terminate the program.
+#
+# $description - Short description of the tests
+#
+# Returns: undef
+sub skip_unless_automated {
+ my ($description) = @_;
+ for my $env (qw(AUTOMATED_TESTING RELEASE_TESTING AUTHOR_TESTING)) {
+ return if $ENV{$env};
+ }
+ plan skip_all => "$description normally skipped";
+ return;
+}
+
+# Attempt to load a module and skip the test if the module could not be
+# loaded. If the module could be loaded, call its import function manually.
+# If the module could not be loaded, calls plan skip_all, which will terminate
+# the program.
+#
+# The special logic here is based on Test::More and is required to get the
+# imports to happen in the caller's namespace.
+#
+# $module - Name of the module to load
+# @imports - Any arguments to import, possibly including a version
+#
+# Returns: undef
+sub use_prereq {
+ my ($module, @imports) = @_;
+
+ # If the first import looks like a version, pass it as a bare string.
+ my $version = q{};
+ if (@imports >= 1 && $imports[0] =~ m{ \A \d+ (?: [.][\d_]+ )* \z }xms) {
+ $version = shift(@imports);
+ }
+
+ # Get caller information to put imports in the correct package.
+ my ($package) = caller;
+
+ # Do the import with eval, and try to isolate it from the surrounding
+ # context as much as possible. Based heavily on Test::More::_eval.
+ ## no critic (BuiltinFunctions::ProhibitStringyEval)
+ ## no critic (ValuesAndExpressions::ProhibitImplicitNewlines)
+ my ($result, $error, $sigdie);
+ {
+ local $@ = undef;
+ local $! = undef;
+ local $SIG{__DIE__} = undef;
+ $result = eval qq{
+ package $package;
+ use $module $version \@imports;
+ 1;
+ };
+ $error = $@;
+ $sigdie = $SIG{__DIE__} || undef;
+ }
+
+ # If the use failed for any reason, skip the test.
+ if (!$result || $error) {
+ my $name = length($version) > 0 ? "$module $version" : $module;
+ plan skip_all => "$name required for test";
+ }
+
+ # If the module set $SIG{__DIE__}, we cleared that via local. Restore it.
+ ## no critic (Variables::RequireLocalizedPunctuationVars)
+ if (defined($sigdie)) {
+ $SIG{__DIE__} = $sigdie;
+ }
+ return;
+}
+
+1;
+__END__
+
+=for stopwords
+Allbery Allbery's DESC bareword sublicense MERCHANTABILITY NONINFRINGEMENT
+rra-c-util
+
+=head1 NAME
+
+Test::RRA - Support functions for Perl tests
+
+=head1 SYNOPSIS
+
+ use Test::RRA
+ qw(skip_unless_author skip_unless_automated use_prereq);
+
+ # Skip this test unless author tests are requested.
+ skip_unless_author('Coding style tests');
+
+ # Skip this test unless doing automated or release testing.
+ skip_unless_automated('POD syntax tests');
+
+ # Load modules, skipping the test if they're not available.
+ use_prereq('Perl6::Slurp', 'slurp');
+ use_prereq('Test::Script::Run', '0.04');
+
+=head1 DESCRIPTION
+
+This module collects utility functions that are useful for Perl test
+scripts. It assumes Russ Allbery's Perl module layout and test
+conventions and will only be useful for other people if they use the
+same conventions.
+
+=head1 FUNCTIONS
+
+None of these functions are imported by default. The ones used by a
+script should be explicitly imported.
+
+=over 4
+
+=item skip_unless_author(DESC)
+
+Checks whether AUTHOR_TESTING is set in the environment and skips the
+whole test (by calling C<plan skip_all> from Test::More) if it is not.
+DESC is a description of the tests being skipped. A space and C<only run
+for author> will be appended to it and used as the skip reason.
+
+=item skip_unless_automated(DESC)
+
+Checks whether AUTHOR_TESTING, AUTOMATED_TESTING, or RELEASE_TESTING are
+set in the environment and skips the whole test (by calling C<plan
+skip_all> from Test::More) if they are not. This should be used by tests
+that should not run during end-user installs of the module, but which
+should run as part of CPAN smoke testing and release testing.
+
+DESC is a description of the tests being skipped. A space and C<normally
+skipped> will be appended to it and used as the skip reason.
+
+=item use_prereq(MODULE[, VERSION][, IMPORT ...])
+
+Attempts to load MODULE with the given VERSION and import arguments. If
+this fails for any reason, the test will be skipped (by calling C<plan
+skip_all> from Test::More) with a skip reason saying that MODULE is
+required for the test.
+
+VERSION will be passed to C<use> as a version bareword if it looks like a
+version number. The remaining IMPORT arguments will be passed as the
+value of an array.
+
+=back
+
+=head1 AUTHOR
+
+Russ Allbery <eagle@eyrie.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2013, 2014 The Board of Trustees of the Leland Stanford Junior
+University
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+=head1 SEE ALSO
+
+Test::More(3), Test::RRA::Automake(3), Test::RRA::Config(3)
+
+This module is maintained in the rra-c-util package. The current version
+is available from L<http://www.eyrie.org/~eagle/software/rra-c-util/>.
+
+The functions to control when tests are run use environment variables
+defined by the L<Lancaster
+Consensus|https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md>.
+
+=cut
diff --git a/cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm b/cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm
new file mode 100644
index 0000000000..6d413164d1
--- /dev/null
+++ b/cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm
@@ -0,0 +1,218 @@
+# Configuration for Perl test cases.
+#
+# In order to reuse the same Perl test cases in multiple packages, I use a
+# configuration file to store some package-specific data. This module loads
+# that configuration and provides the namespace for the configuration
+# settings.
+#
+# The canonical version of this file is maintained in the rra-c-util package,
+# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+
+package Test::RRA::Config;
+
+use 5.006;
+use strict;
+use warnings;
+
+# For Perl 5.006 compatibility.
+## no critic (ClassHierarchies::ProhibitExplicitISA)
+
+use Exporter;
+use Test::More;
+
+# Declare variables that should be set in BEGIN for robustness.
+our (@EXPORT_OK, @ISA, $VERSION);
+
+# Set $VERSION and everything export-related in a BEGIN block for robustness
+# against circular module loading (not that we load any modules, but
+# consistency is good).
+BEGIN {
+ @ISA = qw(Exporter);
+ @EXPORT_OK = qw(
+ $COVERAGE_LEVEL @COVERAGE_SKIP_TESTS @CRITIC_IGNORE $LIBRARY_PATH
+ $MINIMUM_VERSION %MINIMUM_VERSION @POD_COVERAGE_EXCLUDE @STRICT_IGNORE
+ @STRICT_PREREQ
+ );
+
+ # This version should match the corresponding rra-c-util release, but with
+ # two digits for the minor version, including a leading zero if necessary,
+ # so that it will sort properly.
+ $VERSION = '5.04';
+}
+
+# If BUILD or SOURCE are set in the environment, look for data/perl.conf under
+# those paths for a C Automake package. Otherwise, look in t/data/perl.conf
+# for a standalone Perl module. Don't use Test::RRA::Automake since it may
+# not exist.
+our $PATH;
+for my $base ($ENV{BUILD}, $ENV{SOURCE}, 't') {
+ next if !defined($base);
+ my $path = "$base/data/perl.conf";
+ if (-r $path) {
+ $PATH = $path;
+ last;
+ }
+}
+if (!defined($PATH)) {
+ BAIL_OUT('cannot find data/perl.conf');
+}
+
+# Pre-declare all of our variables and set any defaults.
+our $COVERAGE_LEVEL = 100;
+our @COVERAGE_SKIP_TESTS;
+our @CRITIC_IGNORE;
+our $LIBRARY_PATH;
+our $MINIMUM_VERSION = '5.008';
+our %MINIMUM_VERSION;
+our @POD_COVERAGE_EXCLUDE;
+our @STRICT_IGNORE;
+our @STRICT_PREREQ;
+
+# Load the configuration.
+if (!do($PATH)) {
+ my $error = $@ || $! || 'loading file did not return true';
+ BAIL_OUT("cannot load data/perl.conf: $error");
+}
+
+1;
+__END__
+
+=for stopwords
+Allbery rra-c-util Automake perlcritic .libs namespace subdirectory
+sublicense MERCHANTABILITY NONINFRINGEMENT
+
+=head1 NAME
+
+Test::RRA::Config - Perl test configuration
+
+=head1 SYNOPSIS
+
+ use Test::RRA::Config qw($MINIMUM_VERSION);
+ print "Required Perl version is $MINIMUM_VERSION\n";
+
+=head1 DESCRIPTION
+
+Test::RRA::Config encapsulates per-package configuration for generic Perl
+test programs that are shared between multiple packages using the
+rra-c-util infrastructure. It handles locating and loading the test
+configuration file for both C Automake packages and stand-alone Perl
+modules.
+
+Test::RRA::Config looks for a file named F<data/perl.conf> relative to the
+root of the test directory. That root is taken from the environment
+variables BUILD or SOURCE (in that order) if set, which will be the case
+for C Automake packages using C TAP Harness. If neither is set, it
+expects the root of the test directory to be a directory named F<t>
+relative to the current directory, which will be the case for stand-alone
+Perl modules.
+
+The following variables are supported:
+
+=over 4
+
+=item $COVERAGE_LEVEL
+
+The coverage level achieved by the test suite for Perl test coverage
+testing using Test::Strict, as a percentage. The test will fail if test
+coverage less than this percentage is achieved. If not given, defaults
+to 100.
+
+=item @COVERAGE_SKIP_TESTS
+
+Directories under F<t> whose tests should be skipped when doing coverage
+testing. This can be tests that won't contribute to coverage or tests
+that don't run properly under Devel::Cover for some reason (such as ones
+that use taint checking). F<docs> and F<style> will always be skipped
+regardless of this setting.
+
+=item @CRITIC_IGNORE
+
+Additional directories to ignore when doing recursive perlcritic testing.
+The contents of this directory must be either top-level directory names or
+directory names starting with F<tests/>.
+
+=item $LIBRARY_PATH
+
+Add this directory (or a F<.libs> subdirectory) relative to the top of the
+source tree to LD_LIBRARY_PATH when checking the syntax of Perl modules.
+This may be required to pick up libraries that are used by in-tree Perl
+modules so that Perl scripts can pass a syntax check.
+
+=item $MINIMUM_VERSION
+
+Default minimum version requirement for included Perl scripts. If not
+given, defaults to 5.008.
+
+=item %MINIMUM_VERSION
+
+Minimum version exceptions for specific directories. The keys should be
+minimum versions of Perl to enforce. The value for each key should be a
+reference to an array of either top-level directory names or directory
+names starting with F<tests/>. All files in those directories will have
+that minimum Perl version constraint imposed instead of $MINIMUM_VERSION.
+
+=item @POD_COVERAGE_EXCLUDE
+
+Regexes that match method names that should be excluded from POD coverage
+testing. Normally, all methods have to be documented in the POD for a
+Perl module, but methods matching any of these regexes will be considered
+private and won't require documentation.
+
+=item @STRICT_IGNORE
+
+Additional directories to ignore when doing recursive Test::Strict testing
+for C<use strict> and C<use warnings>. The contents of this directory
+must be either top-level directory names or directory names starting with
+F<tests/>.
+
+=item @STRICT_PREREQ
+
+A list of Perl modules that have to be available in order to do meaningful
+Test::Strict testing. If any of the modules cannot be loaded via C<use>,
+Test::Strict checking will be skipped. There is currently no way to
+require specific versions of the modules.
+
+=back
+
+No variables are exported by default, but the variables can be imported
+into the local namespace to avoid long variable names.
+
+=head1 AUTHOR
+
+Russ Allbery <eagle@eyrie.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2013, 2014 The Board of Trustees of the Leland Stanford Junior
+University
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+=head1 SEE ALSO
+
+perlcritic(1), Test::MinimumVersion(3), Test::RRA(3),
+Test::RRA::Automake(3), Test::Strict(3)
+
+This module is maintained in the rra-c-util package. The current version
+is available from L<http://www.eyrie.org/~eagle/software/rra-c-util/>.
+
+The C TAP Harness test driver and libraries for TAP-based C testing are
+available from L<http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+
+=cut
diff --git a/cpan/Term-ANSIColor/t/aliases-func.t b/cpan/Term-ANSIColor/t/module/aliases-func.t
index 75a6031f64..7ba1c3ef9d 100644..100755
--- a/cpan/Term-ANSIColor/t/aliases-func.t
+++ b/cpan/Term-ANSIColor/t/module/aliases-func.t
@@ -2,7 +2,7 @@
#
# Test setting color aliases via the function interface.
#
-# Copyright 2012 Russ Allbery <rra@stanford.edu>
+# Copyright 2012 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
diff --git a/cpan/Term-ANSIColor/t/basic.t b/cpan/Term-ANSIColor/t/module/basic.t
index 10ae7431da..735ce529ff 100644..100755
--- a/cpan/Term-ANSIColor/t/basic.t
+++ b/cpan/Term-ANSIColor/t/module/basic.t
@@ -2,8 +2,8 @@
#
# Basic test suite for the Term::ANSIColor Perl module.
#
-# Copyright 1997, 1998, 2000, 2001, 2002, 2005, 2006, 2009, 2010, 2012
-# Russ Allbery <rra@stanford.edu>
+# Copyright 1997, 1998, 2000, 2001, 2002, 2005, 2006, 2009, 2010, 2012, 2014
+# Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -241,7 +241,6 @@ like(
# Test error reporting when calling unrecognized Term::ANSIColor subs that go
# through AUTOLOAD.
-## no critic (ErrorHandling::RequireCheckingReturnValueOfEval)
ok(!eval { Term::ANSIColor::RSET() }, 'Running invalid constant');
like(
$@,
diff --git a/cpan/Term-ANSIColor/t/basic256.t b/cpan/Term-ANSIColor/t/module/basic256.t
index 266db8747b..a24b0cef37 100644..100755
--- a/cpan/Term-ANSIColor/t/basic256.t
+++ b/cpan/Term-ANSIColor/t/module/basic256.t
@@ -3,7 +3,7 @@
# Tests for 256-color support.
#
# Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com>
-# Copyright 2012, 2013 Russ Allbery <rra@stanford.edu>
+# Copyright 2012, 2013 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
diff --git a/cpan/Term-ANSIColor/t/eval.t b/cpan/Term-ANSIColor/t/module/eval.t
index 60e1aa7d18..b5332ee504 100644..100755
--- a/cpan/Term-ANSIColor/t/eval.t
+++ b/cpan/Term-ANSIColor/t/module/eval.t
@@ -6,7 +6,7 @@
# processing and lose its value or leak $@ values to the calling program.
# This is a regression test to ensure that this problem doesn't return.
#
-# Copyright 2012 Russ Allbery <rra@stanford.edu>
+# Copyright 2012, 2013, 2014 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -14,7 +14,7 @@
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 15;
# We refer to $@ in the test descriptions.
## no critic (ValuesAndExpressions::RequireInterpolationOfMetachars)
@@ -32,7 +32,29 @@ is($@, q{}, '... and $@ is empty');
# Store something in $@ and ensure it doesn't get clobbered.
## no critic (BuiltinFunctions::ProhibitStringyEval)
-## no critic (ErrorHandling::RequireCheckingReturnValueOfEval)
eval 'sub { syntax';
is((BLINK 'test'), "\e[5mtest", 'BLINK works after eval failure');
isnt($@, q{}, '... and $@ still contains something useful');
+
+# Do some additional unnecessary testing so that coverage analysis works
+# properly. First, check disabled colors.
+local $ENV{ANSI_COLORS_DISABLED} = 1;
+is(BOLD, q{}, 'ANSI_COLORS_DISABLED works for BOLD');
+is(BLINK, q{}, '...and for BLINK');
+delete $ENV{ANSI_COLORS_DISABLED};
+
+# Now, AUTORESET.
+$Term::ANSIColor::AUTORESET = 1;
+is((BOLD 't'), "\e[1mt\e[0m", 'AUTORESET works for BOLD');
+is((BLINK 't'), "\e[5mt\e[0m", '...and for BLINK');
+is((BOLD), "\e[1m", 'AUTORESET without text for BOLD');
+is((BLINK), "\e[5m", '...and for BLINK');
+$Term::ANSIColor::AUTORESET = 0;
+
+# And, finally, AUTOLOCAL.
+$Term::ANSIColor::AUTOLOCAL = 1;
+is((BOLD 't'), "\e[1mt\e[0m", 'AUTOLOCAL works for BOLD');
+is((BLINK 't'), "\e[5mt\e[0m", '...and for BLINK');
+is((BOLD), "\e[1m", 'AUTOLOCAL without text for BOLD');
+is((BLINK), "\e[5m", '...and for BLINK');
+$Term::ANSIColor::AUTOLOCAL = 0;
diff --git a/cpan/Term-ANSIColor/t/stringify.t b/cpan/Term-ANSIColor/t/module/stringify.t
index 4833593048..acb558dbdf 100644..100755
--- a/cpan/Term-ANSIColor/t/stringify.t
+++ b/cpan/Term-ANSIColor/t/module/stringify.t
@@ -3,7 +3,7 @@
# Test suite for stringify interaction.
#
# Copyright 2011 Revilo Reegiles
-# Copyright 2011 Russ Allbery <rra@stanford.edu>
+# Copyright 2011, 2014 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -17,7 +17,7 @@ use Test::More tests => 6;
## no critic (Modules::ProhibitMultiplePackages)
package Test::Stringify;
use overload '""' => 'stringify';
-sub new { return bless {}, 'Test::Stringify' }
+sub new { return bless({}, 'Test::Stringify') }
sub stringify { return "Foo Bar\n" }
# Back to the main package.
@@ -44,6 +44,7 @@ $result = colored($test, 'bold blue');
is($result, "\e[1;34mFoo Bar\n\e[0m", 'colored with a non-array reference');
# Create a hash reference and try stringifying it.
+## no critic (RegularExpressions::ProhibitEscapedMetacharacters)
my %foo = (foo => 'bar');
$result = colored(\%foo, 'bold blue');
like(
diff --git a/cpan/Term-ANSIColor/t/taint.t b/cpan/Term-ANSIColor/t/taint/basic.t
index 458e27f2e7..53a6bb667c 100644..100755
--- a/cpan/Term-ANSIColor/t/taint.t
+++ b/cpan/Term-ANSIColor/t/taint/basic.t
@@ -7,7 +7,7 @@
# an environment variable). Term::ANSIColor does the work to untaint it; be
# sure that the taint flag is properly cleared.
#
-# Copyright 2012 Russ Allbery <rra@stanford.edu>
+# Copyright 2012 Russ Allbery <rra@cpan.org>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.