Raku Land

Test::When

github:raku-community-modules

Build Status

NAME

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

TABLE OF CONTENTS

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

REPOSITORY

Fork this module on GitHub: https://github.com/raku-community-modules/Test-When

BUGS

To report bugs or request features, please use https://github.com/raku-community-modules/Test-When/issues

AUTHOR

Zoffix Znet (http://zoffix.com/)

LICENSE

You can use and distribute this module under the terms of the The Artistic License 2.0. See the LICENSE file included in this distribution for complete details.