Test::RRA::Config

(Perl test configuration)

SYNOPSIS

    use Test::RRA::Config qw($MINIMUM_VERSION);
    print "Required Perl version is $MINIMUM_VERSION\n";

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 data/perl.conf relative to the root of the test directory. That root is taken from the environment variables C_TAP_BUILD or C_TAP_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 t relative to the current directory, which will be the case for stand-alone Perl modules.

The following variables are supported:

$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.

@COVERAGE_SKIP_TESTS

Directories under 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). docs and style will always be skipped regardless of this setting.

@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 tests/.

$LIBRARY_PATH

Add this directory (or a .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.

$MINIMUM_VERSION

Default minimum version requirement for included Perl scripts. If not given, defaults to 5.008.

%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 tests/. All files in those directories will have that minimum Perl version constraint imposed instead of $MINIMUM_VERSION.

@MODULE_VERSION_IGNORE

File names to ignore when checking that all modules in a distribution have the same version. Sometimes, some specific modules need separate, special version handling, such as modules defining database schemata for DBIx::Class, and can't follow the version of the larger package.

@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.

@STRICT_IGNORE

Additional directories to ignore when doing recursive Test::Strict testing for use strict and use warnings. The contents of this directory must be either top-level directory names or directory names starting with tests/.

@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 use, Test::Strict checking will be skipped. There is currently no way to require specific versions of the modules.

No variables are exported by default, but the variables can be imported into the local namespace to avoid long variable names.

AUTHOR

Russ Allbery <eagle@eyrie.org>

COPYRIGHT AND LICENSE

Copyright 2015, 2016 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.

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 <https://www.eyrie.org/~eagle/software/rra-c-util/>.

The C TAP Harness test driver and libraries for TAP-based C testing are available from <https://www.eyrie.org/~eagle/software/c-tap-harness/>.

Last modified and spun 2017-06-06