NAME
App::Yath::Options::Tests - Options common to all commands that run tests.
DESCRIPTION
Options common to all commands that run tests.
PROVIDED OPTIONS
Test Options
- --allow-retry
- --no-allow-retry
-
Toggle retry capabilities on and off (default: on)
- -b
- --blib
- --no-blib
-
(Default: include if it exists) Include 'blib/lib' and 'blib/arch' in your module path (These will come after paths you specify with -D or -I)
- --cover
- --cover=-silent,1,+ignore,^t/,+ignore,^t2/,+ignore,^xt,+ignore,^test.pl
- --no-cover
-
Use Devel::Cover to calculate test coverage. This disables forking. If no args are specified the following are used: -silent,1,+ignore,^t/,+ignore,^t2/,+ignore,^xt,+ignore,^test.pl
Can also be set with the following environment variables:
T2_DEVEL_COVER
The following environment variables will be set after arguments are processed:
T2_DEVEL_COVER
- -E key=val
- -E=key=val
- -Ekey=value
- -E '{"json":"hash"}'
- -E='{"json":"hash"}'
- -E:{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
- -E :{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
- -E=:{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
- --env-var key=val
- --env-var=key=val
- --env-vars key=val
- --env-vars=key=val
- --env-var '{"json":"hash"}'
- --env-var='{"json":"hash"}'
- --env-vars '{"json":"hash"}'
- --env-vars='{"json":"hash"}'
- --env-var :{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
- --env-var=:{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
- --env-vars :{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
- --env-vars=:{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
- --no-env-vars
-
Set environment variables
Note: Can be specified multiple times
- --et SECONDS
- --event-timeout SECONDS
- --no-event-timeout
-
Kill test if no output is received within timeout period. (Default: 60 seconds). Add the "# HARNESS-NO-TIMEOUT" comment to the top of a test file to disable timeouts on a per-test basis. This prevents a hung test from running forever.
- --event-uuids
- --no-event-uuids
-
Use Test2::Plugin::UUID inside tests (default: on)
- -I ARG
- -I=ARG
- -I '*.*'
- -I='*.*'
- -I '["json","list"]'
- -I='["json","list"]'
- -I :{ ARG1 ARG2 ... }:
- -I=:{ ARG1 ARG2 ... }:
- --include ARG
- --include=ARG
- --include '*.*'
- --include='*.*'
- --include '["json","list"]'
- --include='["json","list"]'
- --include :{ ARG1 ARG2 ... }:
- --include=:{ ARG1 ARG2 ... }:
- --no-include
-
Add a directory to your include paths
Note: Can be specified multiple times
- --input ARG
- --input=ARG
- --no-input
-
Input string to be used as standard input for ALL tests. See also: --input-file
- --input-file ARG
- --input-file=ARG
- --no-input-file
-
Use the specified file as standard input to ALL tests
- -l
- --lib
- --no-lib
-
(Default: include if it exists) Include 'lib' in your module path (These will come after paths you specify with -D or -I)
- -m ARG
- -m=ARG
- -m '["json","list"]'
- -m='["json","list"]'
- -m :{ ARG1 ARG2 ... }:
- -m=:{ ARG1 ARG2 ... }:
- --load ARG
- --load=ARG
- --load-module ARG
- --load-module=ARG
- --load '["json","list"]'
- --load='["json","list"]'
- --load :{ ARG1 ARG2 ... }:
- --load=:{ ARG1 ARG2 ... }:
- --load-module '["json","list"]'
- --load-module='["json","list"]'
- --load-module :{ ARG1 ARG2 ... }:
- --load-module=:{ ARG1 ARG2 ... }:
- --no-load
-
Load a module in each test (after fork). The "import" method is not called.
Note: Can be specified multiple times
- -M Module
- -M Module=import_arg1,arg2,...
- -M '{"Data::Dumper":["Dumper"]}'
- --loadim Module
- --load-import Module
- --loadim Module=import_arg1,arg2,...
- --loadim '{"Data::Dumper":["Dumper"]}'
- --load-import Module=import_arg1,arg2,...
- --load-import '{"Data::Dumper":["Dumper"]}'
- --no-load-import
-
Load a module in each test (after fork). Import is called.
Note: Can be specified multiple times
- --mem-usage
- --no-mem-usage
-
Use Test2::Plugin::MemUsage inside tests (default: on)
- --pet SECONDS
- --post-exit-timeout SECONDS
- --no-post-exit-timeout
-
Stop waiting post-exit after the timeout period. (Default: 15 seconds) Some tests fork and allow the parent to exit before writing all their output. If Test2::Harness detects an incomplete plan after the test exits it will monitor for more events until the timeout period. Add the "# HARNESS-NO-TIMEOUT" comment to the top of a test file to disable timeouts on a per-test basis.
- -rARG
- -r ARG
- -r=ARG
- --retry ARG
- --retry=ARG
- --no-retry
-
Run any jobs that failed a second time. NOTE: --retry=1 means failing tests will be attempted twice!
- --retry-iso
- --retry-isolated
- --no-retry-isolated
-
If true then any job retries will be done in isolation (as though -j1 was set)
- --stream
- --use-stream
- --no-stream
- --TAP
-
The TAP format is lossy and clunky. Test2::Harness normally uses a newer streaming format to receive test results. There are old/legacy tests where this causes problems, in which case setting --TAP or --no-stream can help.
- -S ARG
- -S=ARG
- -S '["json","list"]'
- -S='["json","list"]'
- -S :{ ARG1 ARG2 ... }:
- -S=:{ ARG1 ARG2 ... }:
- --switch ARG
- --switch=ARG
- --switches ARG
- --switches=ARG
- --switch '["json","list"]'
- --switch='["json","list"]'
- --switches '["json","list"]'
- --switches='["json","list"]'
- --switch :{ ARG1 ARG2 ... }:
- --switch=:{ ARG1 ARG2 ... }:
- --switches :{ ARG1 ARG2 ... }:
- --switches=:{ ARG1 ARG2 ... }:
- --no-switches
-
Pass the specified switch to perl for each test. This is not compatible with preload.
Note: Can be specified multiple times
- --test-arg ARG
- --test-arg=ARG
- --test-args ARG
- --test-args=ARG
- --test-arg '["json","list"]'
- --test-arg='["json","list"]'
- --test-args '["json","list"]'
- --test-args='["json","list"]'
- --test-arg :{ ARG1 ARG2 ... }:
- --test-arg=:{ ARG1 ARG2 ... }:
- --test-args :{ ARG1 ARG2 ... }:
- --test-args=:{ ARG1 ARG2 ... }:
- --no-test-args
-
Arguments to pass in as @ARGV for all tests that are run. These can be provided easier using the '::' argument separator.
Note: Can be specified multiple times
- --tlib
- --no-tlib
-
(Default: off) Include 't/lib' in your module path (These will come after paths you specify with -D or -I)
- --unsafe-inc
- --no-unsafe-inc
-
perl is removing '.' from @INC as a security concern. This option keeps things from breaking for now.
Can also be set with the following environment variables:
PERL_USE_UNSAFE_INC
The following environment variables will be set after arguments are processed:
PERL_USE_UNSAFE_INC
- --fork
- --use-fork
- --no-use-fork
-
(default: on, except on windows) Normally tests are run by forking, which allows for features like preloading. This will turn off the behavior globally (which is not compatible with preloading). This is slower, it is better to tag misbehaving tests with the '# HARNESS-NO-PRELOAD' comment in their header to disable forking only for those tests.
Can also be set with the following environment variables:
!T2_NO_FORK
,T2_HARNESS_FORK
,!T2_HARNESS_NO_FORK
,YATH_FORK
,!YATH_NO_FORK
- --timeout
- --use-timeout
- --no-use-timeout
-
(default: on) Enable/disable timeouts
SOURCE
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.
MAINTAINERS
AUTHORS
COPYRIGHT
Copyright Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.