]> eyrie.org Git - kerberos/krb5-strength.git/commitdiff
Update to rra-c-util 5.4
authorRuss Allbery <eagle@eyrie.org>
Tue, 25 Mar 2014 22:49:20 +0000 (15:49 -0700)
committerRuss Allbery <eagle@eyrie.org>
Tue, 25 Mar 2014 22:49:20 +0000 (15:49 -0700)
* 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.

NEWS
README
tests/docs/pod-spelling-t
tests/docs/pod-t
tests/perl/critic-t
tests/perl/minimum-version-t
tests/perl/strict-t
tests/tap/perl/Test/RRA.pm
tests/tap/perl/Test/RRA/Automake.pm
tests/tap/perl/Test/RRA/Config.pm
tests/util/xmalloc-t

diff --git a/NEWS b/NEWS
index 20726e5f202b14fc84ec5e24707636ce9c0c5d9d..8936ad7ea7eea27b03f2fce82ac729d743d75a3e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,9 +29,11 @@ krb5-strength 3.0 (unreleased)
     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:
 
diff --git a/README b/README
index 24467e213974b797646f39cb9ec60ed568adbb61..688db2a6f543f6e4378693e5ab0de33b0c2ff84e 100644 (file)
--- a/README
+++ b/README
@@ -145,9 +145,12 @@ REQUIREMENTS
   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
index 1a02af8efca52224fc3d294c092373b3f67c84ad..7b61c86382b70f22fb7e3c7cff75e8aac6e31230 100755 (executable)
@@ -1,14 +1,12 @@
 #!/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
@@ -36,11 +34,12 @@ use warnings;
 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');
index 7662b08aaf96d81daaac053e3f5df3569b8155e3..53f9925cbf4496c00b6b015a48215bec2cdef89d 100755 (executable)
@@ -7,7 +7,7 @@
 # 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
@@ -35,9 +35,13 @@ use warnings;
 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');
 
index 75f1928f829b353b65046b744acb65cac0cef487..c66227c39e7c5a25bf7ac691aa3035c9570c3ba7 100755 (executable)
@@ -2,15 +2,11 @@
 #
 # 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
@@ -37,13 +33,15 @@ use warnings;
 
 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();
@@ -51,6 +49,13 @@ 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');
 
@@ -59,3 +64,7 @@ Test::Perl::Critic->import(-profile => test_file_path('data/perlcriticrc'));
 
 # 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');
index 060d51e93a72884057c70bae31625b8dab692b4d..8c493279289b83a8e607de166af06e7396639f70 100755 (executable)
@@ -10,7 +10,7 @@
 # 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
@@ -38,10 +38,13 @@ use warnings;
 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');
 
index 8085afadf08b39fcc707260b545afe517a9248ff..2df6d58c7fdc5b287ed46e80ceb523fed3db9af1 100755 (executable)
@@ -5,8 +5,6 @@
 # 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/>.
@@ -40,10 +38,13 @@ use warnings;
 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');
 
index 3b2a502653a1c90ed67c7c33d0809b1981688f4c..12be88bcab25373632cf4f9644b88e3f4c362876 100644 (file)
@@ -10,7 +10,7 @@
 # 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
@@ -51,29 +51,47 @@ our (@EXPORT_OK, @ISA, $VERSION);
 # 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
@@ -143,10 +161,14 @@ Test::RRA - Support functions for Perl tests
 
 =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');
@@ -166,12 +188,23 @@ script should be explicitly imported.
 
 =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 ...])
 
@@ -192,7 +225,7 @@ Russ Allbery <eagle@eyrie.org>
 
 =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
@@ -220,4 +253,8 @@ 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
index 003e9cde0380a4b63434066e9e818a96180f5197..db293fa8a72c4420c2b425ab38df830e8eff9527 100644 (file)
@@ -87,7 +87,7 @@ BEGIN {
     # 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
index ce7b1f5bf0608041067b692ba8f0331f93dc422e..6d413164d1b86455f1276745bfc9afe4f720c647 100644 (file)
@@ -37,7 +37,7 @@ BEGIN {
     # 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
index 74e4bbd2462278f18922cfc0bfbb5582056af62c..c47c644aebd096d5c86c4e02a109deda2af6b594 100755 (executable)
@@ -6,7 +6,7 @@
 # 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
 #
@@ -59,8 +59,8 @@ ok_xmalloc () {
 # 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.