NAME
App::Yath::Command::test - Command to run tests
DESCRIPTION
SYNOPSIS
COMMAND LINE USAGE
$ yath test [options] [--] [test files/dirs] [::] [arguments to test scripts]
Help
- --show-opts
-
Exit after showing what yath thinks your options mean
- -h
- --help
-
Exit after showing this help message
Harness Options
- --id ID
- --run_id ID
-
Set a specific run-id
(Default: current timestamp)
- --no-long
-
Do not run tests with the HARNESS-CAT-LONG header
- --shm
- --no-shm
-
Use shm for tempdir if possible (Default: on)
Do not use shm.
- -C
- --clear
-
Clear the work directory if it is not already empty
- -D
- --dummy
-
Dummy run, do not actually execute tests
- -d path
- --dir path
- --workdir path
-
Set the work directory
(Default: new temp directory)
- -j #
- --jobs #
- --job-count #
-
Set the number of concurrent jobs to run
(Default: 1)
- -m Module
- --load Module
- --load-module Mod
-
Load a module in each test (after fork)
this option may be given multiple times
- -M Module
- --loadim Module
- --load-import Mod
-
Load and import module in each test (after fork)
this option may be given multiple times
- -P Module
- --preload Module
-
Preload a module before running tests
this option may be given multiple times
- -t path/
- --tmpdir path/
-
Use a specific temp directory
(Default: use system temp dir)
- -X foo
- --exclude-pattern bar
-
Exclude files that match
May be specified multiple times
matched using `m/$PATTERN/`
- -x t/bad.t
- --exclude-file t/bad.t
-
Exclude a file from testing
May be specified multiple times
- --et SECONDS
- --event_timeout #
-
Kill test if no events received in timeout period
(Default: 60 seconds)
This is used to prevent the harness for waiting forever for a hung test. Add the "# HARNESS-NO-TIMEOUT" comment to the top of a test file to disable timeouts on a per-test basis.
- --no-preload
-
cancel any preloads listed until now
This can be used to negate preloads specified in .yath.rc or similar
- --pet SECONDS
- --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 exists 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.
Job Options
- --blib
- --no-blib
-
(Default: on) Include 'blib/lib' and 'blib/arch'
Do not include 'blib/lib' and 'blib/arch'
- --input-file file
-
Use the specified file as standard input to ALL tests
- --lib
- --no-lib
-
(Default: on) Include 'lib' in your module path
Do not include 'lib'
- --tlib
-
(Default: off) Include 't/lib' in your module path
- -E VAR=value
- --env-var VAR=val
-
Set an environment variable for each test
(but not the harness)
- -i "string"
-
This input string will be used as standard input for ALL tests
See also --input-file
- -I path/lib
- --include lib/
-
Add a directory to your include paths
This can be used multiple times
- --cover
-
use Devel::Cover to calculate test coverage
This is essentially the same as combining: '--no-fork', and '-MDevel::Cover=-silent,1,+ignore,^t/,+ignore,^t2/,+ignore,^xt,+ignore,^test.pl' Devel::Cover and preload/fork do not work well together.
- --default_search t
-
ARRAY(0x2853180)
- --fork
- --no-fork
-
(Default: on) fork to start tests
Do not fork to start tests
Test2::Harness normally forks to start a test. Forking can break some select tests, this option will allow such tests to pass. This is not compatible with the "preload" option. This is also significantly slower. You can also add the "# HARNESS-NO-PRELOAD" comment to the top of the test file to enable this on a per-test basis.
- --stream
- --no-stream
- --TAP
- --tap
-
Use 'stream' instead of TAP (Default: use stream)
Do not use stream
Use 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.
- --unsafe-inc
- --no-unsafe-inc
-
(Default: On) put '.' in @INC
Do not put '.' in @INC
perl is removing '.' from @INC as a security concern. This option keeps things from breaking for now.
- -A
-
This will set the AUTHOR_TESTING environment to true
Many cpan modules have tests that are only run if the AUTHOR_TESTING environment variable is set. This will cause those tests to run.
- -k
- --keep-dir
-
Do not delete the work directory when done
This is useful if you want to inspect the work directory after the harness is done. The work directory path will be printed at the end.
- -S SW
- -S SW=val
- --switch SW=val
-
Pass the specified switch to perl for each test
This is not compatible with preload.
- -T
- --times
-
Monitor timing data for each test file
This tells perl to load Test2::Plugin::Times before starting each test.
Logging Options
- -B
- --bz2
- --bzip2-log
-
Use bzip2 compression when writing the log
This option implies -L
.bz2 prefix is added to log file name for you
- -F file.jsonl
- --log-file FILE
-
Specify the name of the log file
This option implies -L
(Default: event_log-RUN_ID.jsonl)
- -G
- --gz
- --gzip-log
-
Use gzip compression when writing the log
This option implies -L
.gz prefix is added to log file name for you
- -L
- --log
-
Turn on logging
Display Options
- --color
- --no-color
-
Turn color on (Default: on)
Turn color off
- --show-job-info
- --no-show-job-info
-
Show the job configuration when a job starts
(Default: off, unless -vv)
- --show-job-launch
- --no-show-job-launch
-
Show output for the start of a job
(Default: off unless -v)
- --show-run-info
- --no-show-run-info
-
Show the run configuration when a run starts
(Default: off, unless -vv)
- -q
- --quiet
-
Be very quiet
- -v
- -vv
- --verbose
-
Turn on verbose mode.
Specify multiple times to be more verbose.
- --formatter Mod
- --formatter +Mod
-
Specify the formatter to use
(Default: "Test2")
Only useful when the renderer is set to "Formatter". This specified the Test2::Formatter::XXX that will be used to render the test output.
- --show-job-end
- --no-show-job-end
-
Show output when a job ends
(Default: on)
This is only used when the renderer is set to "Formatter"
- -r +Module
- -r Postfix
- --renderer ...
-
Specify an alternate renderer
(Default: "Formatter")
Use "+" to give a fully qualified module name. Without "+" "Test2::Harness::Renderer::" will be prepended to your argument.
Plugins
- -pPlugin
- -p+My::Plugin
- --plugin Plugin
-
Load a plugin
can be specified multiple times
- --no-plugins
-
cancel any plugins listed until now
This can be used to negate plugins specified in .yath.rc or similar
SOURCE
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.
MAINTAINERS
AUTHORS
COPYRIGHT
Copyright 2017 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.
See http://dev.perl.org/licenses/