Test::Settings(3)

πŸ“¦ version 0.003, in alpine 3.24

πŸ’– NAME πŸ’–

okay so you're on the Test::Settings(3) page from the User Contributed Perl Documentation, and the whole vibe is: Test::Settings β€” Ask or tell when certain types of tests should be run. Like, it's the friend who tells your test suite whether it's smoke-test time, extended-test time, author-test time, etc. πŸ’…

🌸 VERSION 🌸

version 0.003 β€” tiny version number, big main character energy ✨

✨ 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 bunch of environment variables used to control how tests should behave, and sometimes those names or meanings change. Messy, right? 😭

This library tries to give you a consistent interface so testers and toolchain users can figure out the state of testing without having to care about the intricacies behind the scenes. It's giving "emotional support API" 🫢

πŸ” Inspecting the state of things πŸ”

Currently, the following methods are provided to see what the current state of the testing options are. Unless a user or tool explicitly requests otherwise, 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. That means tests should not prompt the user for information. No pop quizzes, bestie. πŸ™ˆ

want_extended

if (want_extended) { ... }

Returns true if extended testing has been requested. Often modules 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. Sanity check before CPAN? Obsessed. βœ…

want_all

if (want_all) { ... }

Returns true if all of the above wants are true.

πŸ› οΈ Changing the state of things πŸ› οΈ

The methods below let you modify the state of testing. Smokers and build tools can use this to inform testing tools how to run. It's literally the group chat setting the plan. πŸ’¬

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. One button, all the vibes. πŸ”˜

πŸŽ€ 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 πŸ‘€

πŸ’Œ AUTHOR πŸ’Œ

Matthew Horsfall (alh) - <wolfsage@gmail.com> β€” iconic author moment πŸ‘‘

πŸ“œ LICENSE πŸ“œ

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

And that's the whole page, bestie. Signed off by perl v5.42.2, dated 2026-02-15, and yes β€” this is the Test::Settings(3) page. Periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from