Commit a517ad35 authored by Russ Allbery's avatar Russ Allbery

Update to rra-c-util 4.12 (to be) and C TAP Harness 2.3

Update to rra-c-util 4.12:

* Better error messages from xasprintf on failure to format output.
* Check return status of vsnprintf properly.
* Significant improvements to POD tests.
* Avoid leaking a dummy symbol from the portability layer.
* Probe for Kerberos headers with file existence checks.

Update to C TAP Harness 2.3:

* runtests now treats the command line as a list of tests by default.
* The full test executable path can now be passed to runtests -o.
* Improved harness output for tests with lazy plans.
* Improved harness output to a terminal for some abort cases.
* Flush harness output after each test even when not on a terminal.
* bail and sysbail now exit with status 255 to match Test::More.
* Suppress lazy plans and test summaries if the test failed with bail.
* Add warn_unused_result gcc attributes to relevant functions.
parent 74fcecf0
......@@ -139,4 +139,4 @@ tests_util_messages_t_LDADD = tests/tap/libtap.a util/libutil.la \
tests_util_xmalloc_LDADD = util/libutil.la portable/libportable.la
check-local: $(check_PROGRAMS)
cd tests && ./runtests $(abs_top_srcdir)/tests/TESTS
cd tests && ./runtests -l $(abs_top_srcdir)/tests/TESTS
......@@ -63,6 +63,25 @@ krb5-sync 3.0 (unreleased)
longer exist by the time we get to them. This makes krb5-sync-backend
more robust against multiple copies running at the same time.
Update to rra-c-util 4.12:
* Better error messages from xasprintf on failure to format output.
* Check return status of vsnprintf properly.
* Significant improvements to POD tests.
* Avoid leaking a dummy symbol from the portability layer.
* Probe for Kerberos headers with file existence checks.
Update to C TAP Harness 2.3:
* runtests now treats the command line as a list of tests by default.
* The full test executable path can now be passed to runtests -o.
* Improved harness output for tests with lazy plans.
* Improved harness output to a terminal for some abort cases.
* Flush harness output after each test even when not on a terminal.
* bail and sysbail now exit with status 255 to match Test::More.
* Suppress lazy plans and test summaries if the test failed with bail.
* Add warn_unused_result gcc attributes to relevant functions.
krb5-sync 2.3 (2012-09-18)
When handling password changes from MIT Kerberos, quietly ignore
......
......@@ -89,6 +89,12 @@ REQUIREMENTS
updates, you will also need to know the server to which to do LDAP
queries (generally, this is one of the Domain Controllers).
To run the full test suite, Perl 5.6.2 or later is required. The
following additional Perl modules will be used if present:
Test::Pod
Test::Spelling
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
later. For bootstrap or if you change configure.ac or any of the m4
......
......@@ -124,7 +124,7 @@ AC_DEFUN([RRA_LIB_HELPER_WITH_OPTIONAL],
[Location of $2 headers and libraries])],
[AS_IF([test x"$withval" = xno],
[rra_use_$3=false],
[AS_IF([test x"$withval" != yes], [rra_$3[]_root="$withval"])
[AS_IF([test x"$withval" != xyes], [rra_$3[]_root="$withval"])
rra_use_$3=true])])
AC_ARG_WITH([$1][-include],
[AS_HELP_STRING([--with-][$1][-include=DIR],
......
......@@ -21,6 +21,8 @@
#include <config.h>
#include <portable/system.h>
#include <errno.h>
/*
* If we're running the test suite, rename the functions to avoid conflicts
* with the system versions.
......@@ -33,6 +35,7 @@ int test_asprintf(char **, const char *, ...)
int test_vasprintf(char **, const char *, va_list);
#endif
int
asprintf(char **strp, const char *fmt, ...)
{
......@@ -45,11 +48,12 @@ asprintf(char **strp, const char *fmt, ...)
return status;
}
int
vasprintf(char **strp, const char *fmt, va_list args)
{
va_list args_copy;
int status, needed;
int status, needed, oerrno;
va_copy(args_copy, args);
needed = vsnprintf(NULL, 0, fmt, args_copy);
......@@ -65,8 +69,10 @@ vasprintf(char **strp, const char *fmt, va_list args)
if (status >= 0)
return status;
else {
oerrno = errno;
free(*strp);
*strp = NULL;
errno = oerrno;
return status;
}
}
......@@ -19,8 +19,10 @@
* work.
*/
/* Prototype to avoid gcc warnings. */
int portable_dummy(void);
#include <portable/macros.h>
/* Prototype to avoid gcc warnings and set visibility. */
int portable_dummy(void) __attribute__((__visibility__("hidden")));
int
portable_dummy(void)
......
......@@ -66,6 +66,31 @@ void krb5_appdefault_string(krb5_context, const char *, const krb5_data *,
const char *, const char *, char **);
#endif
/*
* MIT-specific. The Heimdal documentation says to use free(), but that
* doesn't actually make sense since the memory is allocated inside the
* Kerberos library. Use krb5_xfree instead.
*/
#ifndef HAVE_KRB5_FREE_DEFAULT_REALM
# define krb5_free_default_realm(c, r) krb5_xfree(r)
#endif
/*
* Heimdal: krb5_xfree, MIT: krb5_free_string, older MIT uses free(). Note
* that we can incorrectly allocate in the library and call free() if
* krb5_free_string is not available but something we use that API for is
* available, such as krb5_appdefaults_*, but there isn't anything we can
* really do about it.
*/
#ifndef HAVE_KRB5_FREE_STRING
# ifdef HAVE_KRB5_XFREE
# define krb5_free_string(c, s) krb5_xfree(s)
# else
# define krb5_free_string(c, s) free(s)
# endif
#endif
/* Heimdal: krb5_xfree, MIT: krb5_free_unparsed_name. */
#ifdef HAVE_KRB5_XFREE
# define krb5_free_unparsed_name(c, p) krb5_xfree(p)
......
......@@ -8,9 +8,9 @@
* #include <sys/types.h>
* #include <stdarg.h>
* #include <stdbool.h>
* #include <stddef.h>
* #include <stdio.h>
* #include <stdlib.h>
* #include <stddef.h>
* #include <stdint.h>
* #include <string.h>
* #include <strings.h>
......@@ -43,21 +43,21 @@
#include <portable/macros.h>
/* A set of standard ANSI C headers. We don't care about pre-ANSI systems. */
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include <stdarg.h>
#include <stddef.h>
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#include <sys/types.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
......
# Configuration for Perl tests. -*- perl -*-
# Default minimum version requirement for included Perl scripts.
$MINIMUM_VERSION = '5.006';
# File must end with this line.
1;
#!/usr/bin/perl -w
#!/usr/bin/perl
#
# Check for spelling errors in POD documentation
# 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.
#
# Checks all POD files in the tree for spelling problems using Pod::Spell and
# either aspell or ispell. aspell is preferred. 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/>.
#
# Copyright 2008, 2009, 2011 Russ Allbery <eagle@eyrie.org>
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2012, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
# 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.
use 5.006;
use strict;
use Test::More;
use warnings;
# Skip all spelling tests unless the maintainer environment variable is set.
plan skip_all => 'spelling tests only run for maintainer'
unless $ENV{RRA_MAINTAINER_TESTS};
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
use Test::RRA qw(skip_unless_maintainer use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
# Load required Perl modules.
eval 'use Test::Pod 1.00';
plan skip_all => 'Test::Pod 1.00 required for testing POD' if $@;
eval 'use Pod::Spell';
plan skip_all => 'Pod::Spell required to test POD spelling' if $@;
# Only run this test for the maintainer.
skip_unless_maintainer('Spelling tests');
# Locate a spell-checker. hunspell is not currently supported due to its lack
# of support for contractions (at least in the version in Debian).
my @spell;
my %options = (aspell => [ qw(-d en_US --home-dir=./ list) ],
ispell => [ qw(-d american -l -p /dev/null) ]);
SEARCH: for my $program (qw/aspell ispell/) {
for my $dir (split ':', $ENV{PATH}) {
if (-x "$dir/$program") {
@spell = ("$dir/$program", @{ $options{$program} });
}
last SEARCH if @spell;
}
}
plan skip_all => 'aspell or ispell required to test POD spelling'
unless @spell;
# Load prerequisite modules.
use_prereq('Test::Spelling');
# Prerequisites are satisfied, so we're going to do some testing. Figure out
# what POD files we have and from that develop our plan.
$| = 1;
my @pod = map {
my $pod = "$ENV{SOURCE}/../" . $_;
$pod =~ s,[^/.][^/]*/../,,g;
$pod;
} qw(tools/krb5-sync-backend tools/krb5-sync.pod);
plan tests => scalar @pod;
# Set up Automake testing.
automake_setup();
# Finally, do the checks.
for my $pod (@pod) {
my $child = open (CHILD, '-|');
if (not defined $child) {
BAIL_OUT ("cannot fork: $!");
} elsif ($child == 0) {
my $pid = open (SPELL, '|-', @spell)
or BAIL_OUT ("cannot run @spell: $!");
open (POD, '<', $pod) or BAIL_OUT ("cannot open $pod: $!");
my $parser = Pod::Spell->new;
$parser->parse_from_filehandle (\*POD, \*SPELL);
close POD;
close SPELL;
exit ($? >> 8);
} else {
my @words = <CHILD>;
close CHILD;
SKIP: {
skip "@spell failed for $pod", 1 unless $? == 0;
for (@words) {
s/^\s+//;
s/\s+$//;
}
is ("@words", '', $pod);
}
}
}
# Run the tests.
all_pod_files_spelling_ok(perl_dirs());
#!/usr/bin/perl -w
#
# Test formatting of POD documentation.
# Check all POD documents in the tree, except for any embedded Perl module
# distribution, for POD formatting errors.
#
# 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 2008, 2009, 2011
# Copyright 2012, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
# 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.
use 5.006;
use strict;
use warnings;
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
use Test::RRA qw(use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
# Load prerequisite modules.
use_prereq('Test::Pod');
my @podfiles = qw(tools/krb5-sync-backend tools/krb5-sync.pod);
# Set up Automake testing.
automake_setup();
eval 'use Test::Pod 1.00';
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
my $srcdir = "$ENV{SOURCE}";
$srcdir =~ s,[^/]+/*$,,;
chdir "$srcdir" or die "$0: cannot chdir to $srcdir: $!\n";
all_pod_files_ok (@podfiles);
# Run the tests.
all_pod_files_ok(perl_dirs());
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@
* This file is part of C TAP Harness. The current version plus supporting
* documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
*
* Copyright 2009, 2010, 2011, 2012 Russ Allbery <eagle@eyrie.org>
* Copyright 2009, 2010, 2011, 2012, 2013 Russ Allbery <eagle@eyrie.org>
* Copyright 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2011, 2012
* The Board of Trustees of the Leland Stanford Junior University
*
......@@ -32,7 +32,7 @@
#include <tests/tap/macros.h>
#include <stdarg.h> /* va_list */
#include <sys/types.h> /* size_t */
#include <stddef.h> /* size_t */
/*
* Used for iterating through arrays. ARRAY_SIZE returns the number of
......@@ -55,7 +55,7 @@ extern unsigned long testnum;
void plan(unsigned long count);
/*
* Prepare for lazy planning, in which the plan will be printed automatically
* Prepare for lazy planning, in which the plan will be printed automatically
* at the end of the test program.
*/
void plan_lazy(void);
......@@ -103,22 +103,22 @@ void sysdiag(const char *format, ...)
/* Allocate memory, reporting a fatal error with bail on failure. */
void *bcalloc(size_t, size_t)
__attribute__((__alloc_size__(1, 2), __malloc__));
__attribute__((__alloc_size__(1, 2), __malloc__, __warn_unused_result__));
void *bmalloc(size_t)
__attribute__((__alloc_size__(1), __malloc__));
__attribute__((__alloc_size__(1), __malloc__, __warn_unused_result__));
void *brealloc(void *, size_t)
__attribute__((__alloc_size__(2), __malloc__));
__attribute__((__alloc_size__(2), __malloc__, __warn_unused_result__));
char *bstrdup(const char *)
__attribute__((__malloc__, __nonnull__));
__attribute__((__malloc__, __nonnull__, __warn_unused_result__));
char *bstrndup(const char *, size_t)
__attribute__((__malloc__, __nonnull__));
__attribute__((__malloc__, __nonnull__, __warn_unused_result__));
/*
* Find a test file under BUILD or SOURCE, returning the full path. The
* returned path should be freed with test_file_path_free().
*/
char *test_file_path(const char *file)
__attribute__((__malloc__, __nonnull__));
__attribute__((__malloc__, __nonnull__, __warn_unused_result__));
void test_file_path_free(char *path);
/*
......@@ -126,9 +126,20 @@ void test_file_path_free(char *path);
* returned path should be freed with test_tmpdir_free.
*/
char *test_tmpdir(void)
__attribute__((__malloc__));
__attribute__((__malloc__, __warn_unused_result__));
void test_tmpdir_free(char *path);
/*
* Register a cleanup function that is called when testing ends. All such
* registered functions will be run during atexit handling (and are therefore
* subject to all the same constraints and caveats as atexit functions). The
* function must return void and will be passed one argument, an int that will
* be true if the test completed successfully and false otherwise.
*/
typedef void (*test_cleanup_func)(int);
void test_cleanup_register(test_cleanup_func)
__attribute__((__nonnull__));
END_DECLS
#endif /* TAP_BASIC_H */
......@@ -11,7 +11,7 @@
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2009, 2010, 2011, 2012 Russ Allbery <eagle@eyrie.org>
# Copyright 2006, 2007, 2008
# Copyright 2006, 2007, 2008, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
......@@ -204,7 +204,7 @@ strip_colon_error() {
# Bail out with an error message.
bail () {
echo 'Bail out!' "$@"
exit 1
exit 255
}
# Output a diagnostic on standard error, preceded by the required # mark.
......
......@@ -8,7 +8,7 @@
* This file is part of C TAP Harness. The current version plus supporting
* documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
*
* Copyright 2008, 2012 Russ Allbery <eagle@eyrie.org>
* Copyright 2008, 2012, 2013 Russ Allbery <eagle@eyrie.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
......@@ -58,6 +58,13 @@
# endif
#endif
/* Suppress __warn_unused_result__ if gcc is too old. */
#if !defined(__attribute__) && !defined(__warn_unused_result__)
# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
# define __warn_unused_result__ /* empty */
# endif
#endif
/*
* LLVM and Clang pretend to be GCC but don't support all of the __attribute__
* settings that GCC does. For them, suppress warnings about unknown
......
# 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
# 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_maintainer 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 = '4.11';
}
# 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.
#
# $description - Short description of the tests
#
# Returns: undef
sub skip_unless_maintainer {
my ($description) = @_;
if (!$ENV{RRA_MAINTAINER_TESTS}) {
plan skip_all => "$description only run for maintainer";
}
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_maintainer use_prereq);
# Skip this test unless maintainer tests are requested.
skip_unless_maintainer('Coding style tests');
# Load modules, skipping the test if they're not available.
use_prereq('File::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_maintainer(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.
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.
=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 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/>.
=cut
This diff is collapsed.
# 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