Quattor::Unittest¶
NAME¶
Test::Quattor::Unittest - Baseline unittest module.
DESCRIPTION¶
This is a class to trigger basic unittests. Should be used as follows:
use Test::Quattor::Unittest;
- Adding the test is as simple as
- echo ‘use Test::Quattor::Unittest;’ > 00-tqu.t
FUNCTIONS¶
- import
On import, run the tests.
Pass
notest
to disable automatic testing (only useful when testing this code).Pass
nopod
to set thenopodflag
(fordoc
test) when testing (is ignored whennotest
is passed).
METHODS¶
- new
No options are required/supported
- read_cfg
Read default config followed by optional configfile
tqu.cfg
and optional variable$main::TQU
.Variable can be defined in main test as follows
BEGIN { our $TQU = <<'EOF'; ... EOF }Every test section has at least the
enable
option, set by default. For all other options, read the respective method documentation.
- test
Run all enabled tests, in order
- load
Run basic load test using
use_ok
fromTest::More
.The module(s) can be configured or guessed.
Configuration parameters
- modules
Comma separated list op module names to try to load.
When specified, no guesses are made, only this list is used.
If
:
is passed, the prefix is used.All trailing
:
are removed.
- prefix
A prefix for all modules specified in themodules
option.
- doc
Documentation tests using
Test::Quattor::Doc
.Configuration options
poddirs
,podfiles
,emptypoddirs
,panpaths
andpanout
are parsed as comma-seperated lists and passed toTest::Quattor::Doc->new
.If the
nopodflag
attribute is true, and noemptypoddirs
are defined, theTest::Quattor::Doc::DOC_TARGET_POD
is set asemptypoddirs
.
panpaths
valueNOPAN
is special, as it disables the pan tests.
- tt
Run TT unittests using
Test::Quattor::TextRender::Component
. (This does not apply tometaconfig
tests).Configuration options are passed to
Test::Quattor::TextRender::Component->new
.The tests are only run if the basepath (default to
src/main/resources
) exists.
- critic
Run
Test::Quattor::Critic
Options
- codedirs
Comma-separated list of directories to look for code to test. (Defaults to poddirs (from doc test) ortarget/lib/perl
).
- exclude
A regexp to remove policies from list of fatal policies.
- tidy
Run
Test::Quattor::Tidy
Options
- codedirs
Comma-separated list of directories to look for code to test. (Defaults to poddirs (from doc test) ortarget/lib/perl
).