* Use Lancaster Consensus environment variables to control tests.
* Work around perltidy bug that leaves behind stray log files.
RELEASE_TESTING, AUTOMATED_TESTING, and AUTHOR_TESTING are now used
to control whether to run tests that may not be of interest to the
end user.
be used to reject long strings of identical characters or short
patterns, which may pass other checks but still be too easy to guess.
- Update to rra-c-util 5.3:
+ Update to rra-c-util 5.4:
* Fix portable/krb5.h build with a C++ compiler.
+ * Use Lancaster Consensus environment variables to control tests.
+ * Work around perltidy bug that leaves behind stray log files.
Update to C TAP Harness 3.0:
All are available on CPAN. Those tests will be skipped if the modules
are not available.
- To enable tests that may be sensitive to the local environment or that
- produce a lot of false positives without uncovering many problems, set
- RRA_MAINTAINER_TESTS to a true value.
+ To enable tests that don't detect functionality problems but are used to
+ sanity-check the release, set the environment variable RELEASE_TESTING
+ to a true value. To enable tests that may be sensitive to the local
+ environment or that produce a lot of false positives without uncovering
+ many problems, set the environment variable AUTHOR_TESTING to a true
+ value.
To bootstrap from a Git checkout, or If you change the Automake files
and need to regenerate Makefile.in, you will need Automake 1.11 or
#!/usr/bin/perl
#
# Checks all POD files in the tree for spelling errors using Test::Spelling.
-# This test is disabled unless RRA_MAINTAINER_TESTS is set, since spelling
-# dictionaries vary too much between environments.
#
# 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 2012, 2013
+# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
-use Test::RRA qw(skip_unless_maintainer use_prereq);
+use Test::RRA qw(skip_unless_author use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
-# Only run this test for the maintainer.
-skip_unless_maintainer('Spelling tests');
+# Only run this test for the module author since the required stopwords are
+# too sensitive to the exact spell-checking program and dictionary.
+skip_unless_author('Spelling tests');
# Load prerequisite modules.
use_prereq('Test::Spelling');
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2012, 2013
+# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
-use Test::RRA qw(use_prereq);
+use Test::RRA qw(skip_unless_automated use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
+# Skip this test for normal user installs, since we normally pre-generate all
+# of the documentation and the end user doesn't care.
+skip_unless_automated('POD syntax tests');
+
# Load prerequisite modules.
use_prereq('Test::Pod');
#
# Check for perlcritic errors in included Perl scripts.
#
-# Checks all Perl scripts in the tree for problems uncovered by perlcritic.
-# This test is disabled unless RRA_MAINTAINER_TESTS is set, since coding style
-# will not interfere with functionality.
-#
# 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 2012, 2013
+# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
use lib "$ENV{SOURCE}/tap/perl";
+use File::Spec;
use Test::More;
-use Test::RRA qw(skip_unless_maintainer use_prereq);
+use Test::RRA qw(skip_unless_author use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs test_file_path);
use Test::RRA::Config qw(@CRITIC_IGNORE);
-# Skip tests unless we're running the test suite in maintainer mode.
-skip_unless_maintainer('Coding style tests');
+# Skip tests unless we're running author tests since this test is too
+# sensitive to the exact version of Perl::Critic to be generally useful.
+skip_unless_author('Coding style tests');
# Set up Automake testing.
automake_setup();
# Load prerequisite modules.
use_prereq('Test::Perl::Critic');
+# Due to an annoying bug in Perl::Tidy 20130922, we cannot run tests if the
+# source directory is read-only. It unconditionally tries to create a log
+# file in the current directory and fails to run any checks if it cannot.
+if (!-w File::Spec->curdir()) {
+ plan skip_all => 'Perl::Tidy needs writable source directory';
+}
+
# Force the embedded Perl::Tidy check to use the correct configuration.
local $ENV{PERLTIDY} = test_file_path('data/perltidyrc');
# Finally, run the actual tests.
all_critic_ok(perl_dirs({ skip => [@CRITIC_IGNORE] }));
+
+# On Debian with perltidy 20130922-1, a perltidy.LOG file gets left behind
+# in the current directory. Remove it if it exists.
+unlink('perltidy.LOG');
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2012, 2013
+# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
-use Test::RRA qw(use_prereq);
+use Test::RRA qw(skip_unless_automated use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
use Test::RRA::Config qw($MINIMUM_VERSION %MINIMUM_VERSION);
+# Skip for normal user installs since this doesn't affect functionality.
+skip_unless_automated('Minimum version tests');
+
# Load prerequisite modules.
use_prereq('Test::MinimumVersion');
# Checks all Perl scripts in the tree for problems uncovered by Test::Strict.
# This includes using strict and warnings for every script and ensuring they
# all pass a syntax check. Currently, test suite coverage is not checked.
-# This test is disabled unless RRA_MAINTAINER_TESTS is set, since some scripts
-# may require dependencies that aren't necessarily present.
#
# 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/>.
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
-use Test::RRA qw(use_prereq);
+use Test::RRA qw(skip_unless_automated use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
use Test::RRA::Config qw(@STRICT_IGNORE @STRICT_PREREQ);
+# Skip for normal user installs since this doesn't affect functionality.
+skip_unless_automated('Strictness tests');
+
# Load prerequisite modules.
use_prereq('Test::Strict');
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2013
+# 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
# consistency is good).
BEGIN {
@ISA = qw(Exporter);
- @EXPORT_OK = qw(skip_unless_maintainer use_prereq);
+ @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.02';
+ $VERSION = '5.04';
}
-# Skip this test unless maintainer 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.
+# 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_maintainer {
+sub skip_unless_author {
my ($description) = @_;
- if (!$ENV{RRA_MAINTAINER_TESTS}) {
- plan skip_all => "$description only run for maintainer";
+ 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
=head1 SYNOPSIS
- use Test::RRA qw(skip_unless_maintainer use_prereq);
+ use Test::RRA
+ qw(skip_unless_author skip_unless_automated use_prereq);
- # Skip this test unless maintainer tests are requested.
- skip_unless_maintainer('Coding style tests');
+ # 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');
=over 4
-=item skip_unless_maintainer(DESC)
+=item skip_unless_author(DESC)
-Checks whether RRA_MAINTAINER_TESTS is set in the environment and skips
-the whole test (by calling C<plan skip_all> from Test::More) if it is not.
+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 maintainer> will be appended to it and used as the skip reason.
+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 ...])
=head1 COPYRIGHT AND LICENSE
-Copyright 2013 The Board of Trustees of the Leland Stanford Junior
+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
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
# 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.02';
+ $VERSION = '5.04';
}
# Perl directories to skip globally for perl_dirs. We ignore the perl
# 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 = '4.12';
+ $VERSION = '5.04';
}
# If BUILD or SOURCE are set in the environment, look for data/perl.conf under
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2000, 2001, 2006 Russ Allbery <eagle@eyrie.org>
+# Copyright 2000, 2001, 2006, 2014 Russ Allbery <eagle@eyrie.org>
# Copyright 2008, 2009, 2010, 2012
# The Board of Trustees of the Leland Stanford Junior University
#
# failures in automated testing have been problems with the assumptions around
# memory allocation or problems with the test suite, not problems with the
# underlying xmalloc code.
-if [ -z "$RRA_MAINTAINER_TESTS" ] ; then
- skip_all 'xmalloc tests only run for maintainer'
+if [ -z "$AUTHOR_TESTING" ] ; then
+ skip_all 'xmalloc tests only run for author'
fi
# Total tests.