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
notestto disable automatic testing (only useful when testing this code).Pass
nopodto set thenopodflag(fordoctest) when testing (is ignored whennotestis passed).
METHODS¶
new
No options are required/supported
read_cfg
Read default config followed by optional configfile
tqu.cfgand 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
enableoption, 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_okfromTest::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 the
modulesoption.
doc
Documentation tests using
Test::Quattor::Doc.Configuration options
poddirs,podfiles,emptypoddirs,panpathsandpanoutare parsed as comma-seperated lists and passed toTest::Quattor::Doc->new.If the
nopodflagattribute is true, and noemptypoddirsare defined, theTest::Quattor::Doc::DOC_TARGET_PODis set asemptypoddirs.
panpathsvalueNOPANis special, as it disables the pan tests.
tt
Run TT unittests using
Test::Quattor::TextRender::Component. (This does not apply tometaconfigtests).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::CriticOptions
codedirs
Comma-separated list of directories to look for code to test. (Defaults to poddirs (from doc test) or
target/lib/perl).
exclude
A regexp to remove policies from list of fatal policies.
tidy
Run
Test::Quattor::TidyOptions
codedirs
Comma-separated list of directories to look for code to test. (Defaults to poddirs (from doc test) or
target/lib/perl).