| 1 | # | ||
| 2 | # Copyright (c) 2013-2019 Christian Jaeger, copying@christianjaeger.ch | ||
| 3 | # | ||
| 4 | # This is free software, offered under either the same terms as perl 5 | ||
| 5 | # or the terms of the Artistic License version 2 or the terms of the | ||
| 6 | # MIT License (Expat version). See the file COPYING.md that came | ||
| 7 | # bundled with this file. | ||
| 8 | # | ||
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | Chj::noTEST | ||
| 13 | |||
| 14 | =head1 SYNOPSIS | ||
| 15 | |||
| 16 | 1 | ▶ | use Chj::noTEST; # instead of `use Chj::TEST;` |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | TEST { foo() } "bar"; # will be ignored / garbage collected right away | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | Disable TEST and TEST_STDOUT forms within a package, perhaps because | ||
| 22 | they currently fail or are slow, or so that they never use memory. | ||
| 23 | |||
| 24 | Note that you can alternatively ignore *all* test forms within the | ||
| 25 | whole program by setting the TEST environment variable to 0. Also you | ||
| 26 | can pass package names to `run_tests` to limit the tests to run to | ||
| 27 | those within the given packages. | ||
| 28 | |||
| 29 | =head1 SEE ALSO | ||
| 30 | |||
| 31 | L<Chj::TEST> | ||
| 32 | |||
| 33 | =head1 NOTE | ||
| 34 | |||
| 35 | This is alpha software! Read the status section in the package README | ||
| 36 | or on the L<website|http://functional-perl.org/>. | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||
| 40 | package Chj::noTEST; | ||
| 41 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 42 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 43 | 2 | ▶ | use warnings FATAL => 'uninitialized'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | 2 | ▶ | use Exporter "import"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | |||
| 46 | 2 | our @EXPORT = qw(TEST TEST_STDOUT TEST_EXCEPTION GIVES perhaps_run_tests); | |
| 47 | 2 | our @EXPORT_OK = qw(); | |
| 48 | 2 | our %EXPORT_TAGS = (all => [@EXPORT, @EXPORT_OK]); | |
| 49 | |||
| 50 | 2 | ▶ | use Chj::TEST (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 51 | |||
| 52 | #*import = \&Chj::TEST::import; | ||
| 53 | |||
| 54 | # to avoid the redefinition warning, use the glob: | ||
| 55 | 2 | *import = *Chj::TEST::import; | |
| 56 | |||
| 57 | 1 | ▶ | sub TEST (&$) { () } |
|
Subroutine
TEST: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 58 | |||
| 59 | 0 | ▶ | sub TEST_STDOUT (&$) { () } |
|
Subroutine
TEST_STDOUT: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 60 | |||
| 61 | 0 | ▶ | sub TEST_EXCEPTION (&$) { () } |
|
Subroutine
TEST_EXCEPTION: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 62 | |||
| 63 | 0 | ▶ | sub GIVES (&) { () } |
|
Subroutine
GIVES: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 64 | |||
| 65 | 0 | ▶ | sub perhaps_run_tests { () } |
|
Subroutine
perhaps_run_tests: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 66 | |||
| 67 | 2 | 1 | |