Rand Stats

Test::When

zef:raku-community-modules

Actions Status Actions Status Actions Status

NAME

Test::When - Selectively run tests based on the environment and installed modules and libs

SYNOPSIS

use Test::When <release author>,
  :modules<Extra::Features  More::Options>,
  :libs( 'someClib', any(<sqlite3 mysql pg>) );

UNIMPLEMENTED / SPEC

The :modules and :libs restrictions aren't yet implemented, but will be soon. Checkout the SPECIFICATION for details on what they will do.

DESCRIPTION

This module lets you write selective tests that will only run when user requested, say, network tests to run, or when the runner of the tests explicitly requested any interactive tests to be avoided. These checks are heavily based on the decisions by the Lancaster Consensus.

Currently unimplemented. The module also allows run tests only when a specific module or C library are installed. This is handy when your module offers extra optional functionality dependent on extra stuff, for example.

USAGE

The type of tests your test file represents is specified on the use line of Test::When module.

Environmental Variable Controlled Tests

use Test::When <author extended>;

The type of test environment to look for is set by positional arguments provided on the use line. Multiple positional arguments can be combined. Whether your tests run depends on the set environmental variables.

The following positional arguments are supported:

smoke

use Test::When <smoke>;

Tests to run when either AUTOMATED_TESTING or ALL_TESTING env vars are true.

interactive

use Test::When <interactive>;

Tests must NOT be run when NONINTERACTIVE_TESTING is set to true, unless ALL_TESTING is also set to true.

extended

use Test::When <extended>;

Tests to be run when either EXTENDED_TESTING, RELEASE_TESTING, or ALL_TESTING env var is set to true.

release

use Test::When <release>;

Tests to be run when RELEASE_TESTING or ALL_TESTING env var is set to true.

author

use Test::When <author>;

Tests to be run when AUTHOR_TESTING or ALL_TESTING env var is set to true.

online

use Test::When <online>;

Tests to be run when ONLINE_TESTING or ALL_TESTING env var is set to true.

Meaning of the Respected Environmental Variables

AUTHOR

Zoffix Znet

COPYRIGHT AND LICENSE

Copyright 2016 - 2017 Zoffix Znet

Copyright 2020 - 2025 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.