NAME

Test::Settings - Ask or tell when certain types of tests should be run

VERSION

version 0.002

SYNOPSIS

Check the current settings

use Test::Settings qw(:all);

if (want_smoke) {
  printf("I must be a smoke tester\n");
}  

if (want_non_interactive) { ... }
if (want_extended) { ... }
if (want_author) { ... }
if (want_release) { ... }

if (want_all) { ... }

Change settings

enable_smoke;
enable_non_interactive;
enable_extended;
enable_author;
enable_release;
enable_all;

disable_smoke;
disable_non_interactive;
disable_extended;
disable_author;
disable_release;
disable_all;

Helper - see the settings as a string

print current_settings;

Print enabled settings as ENV vars

print current_settings_env;

Print all settings as ENV vars

print current_settings_env_all;

DESCRIPTION

There are a number of Environment variables used to control how tests should behave, and sometimes these can change names or meaning.

This library tries to provide a consistent interface so that testers/toolchain users can determine the state of testing without having to care about the intricacies behind the scenes.

Inspecting the state of things

Currently, the following methods are provided to see what the current state of testing options are. Unless explicitly requested by a user or tool, these will usually all return false.

want_smoke

if (want_smoke) { ... }

Returns true if we are currently being run by a smoker or a 'robot'.

want_non_interactive

if (want_non_interactive) { ... }

Returns true if we are in non-interactive mode. This means tests should not prompt the user for information.

want_extended

if (want_extended) { ... }

Returns true if extended testing has been requested. Often modules will ship with extra (non author/release) tests that users may opt in to run.

want_author

if (want_author) { ... }

Returns true if author testing has been requested. Author tests are used during development time only.

want_release

if (want_release) { ... }

Returns true if release testing has been requested. Release tests are used when a new release of a distribution is going to be built to check sanity before pushing to CPAN.

want_all

if (want_all) { ... }

Returns true if all of the above wants are true.

Changing the state of things

The methods below allow modification of the state of testing. This can be used by smokers and build tools to inform testing tools how to run.

enable_smoke

disable_smoke

enable_smoke();
disable_smoke();

This enables or disables (default) smoke testing.

enable_non_interactive

disable_non_interactive

enable_non_interactive();
disable_non_interactive();

This enables or disables (default) non-interactive testing.

enable_extended

disable_extended

enable_extended();
disable_extended();

This enables or disables (default) extended testing.

enable_author

disable_author

enable_author();
disable_author();

This enables or disables (default) author testing.

enable_release

disable_release

enable_release();
disable_release();

This enables or disables (default) release testing.

enable_all

disable_all

Enable or disable all of the test switches at once.

Extra information

If you'd like a quick representation of the current state of things, the methods below will help you inspect them.

current_settings

my $str = current_settings();
print $str;

Displays a table of the current settings of all wants.

current_settings_env

my $str = current_settings_env();
print $str;

Prints enabled settings only as ENV vars.

current_settings_env_all

my $str = current_settings_env_all();
print $str

Prints ALL settings asa ENV vars.

SEE ALSO

Test::S - Change test settings on the command line

Test::DescribeMe - Tell test runners what kind of test you are

Test::Is - Skip test in a declarative way, following the Lancaster Consensus

AUTHOR

Matthew Horsfall (alh) - <wolfsage@gmail.com>

LICENSE

You may distribute this code under the same terms as Perl itself.