NAME
Fennec::Manual::Standalone - Writing stand-alone fennec tests.
DESCRIPTION
This is documentation for a standalone test, that is a test that does not require anything outside each test file. This is perfectly acceptable, but not ideal. You should also read Fennec::Manual::Tests for more information on writing Fennec tests.
A consequence of standalone tests is a loss of parallelization, and the overhead of loading fennec for each standlone test. When fennec is used to manage a suite it is loaded only once, and it can parallelize running of both test files and test groups.
SYNOPSIS
t/mystandalone.t
#!/usr/bin/perl;
package TEST::MyStandaloneTest;
use strict;
use warnings;
use Fennec::Standalone;
use_or_skip 'Module::Name';
tests hello_world_group {
ok( 1, "Hello world" );
}
done_testing();
Breakdown
- package TEST::MyStandaloneTest;
-
Fennec tests must all be contained inside test packages, they will be used as objects.
- use Fennec::Standalone;
-
Use the standalone fennec package. You can specify any options Fennec will accept. You can also configure the temporary runner that will be used. Note none of these options are required, reasonable defaults will be chosen in most cases.
use Fennec::Standalone random => $bool, sort => $bool, asserts => \@list, workflows => \@list, meta => { ... }, runner => { collector => 'Files', cull_delay => .01, handlers => [qw/ TAP /], parallel_files => 2, parallel_tests => 2, };
- tests name { ... }
- done_testing()
-
Fennec runs your test groups and workflows after the package is loaded. In normal Fennec tests done_testing() is not necessary. However in Standalone tests fennec needs a trigger to tell it that the workflows are ready to be run.
USER DOCUMENTATION
User documentation is for those who wish to use Fennec to write simple tests, or manage a test suite for a project.
DEVELOPER DOCUMENTATION
Developer documentation is for those who wish to extend Fennec, or contribute to overall Fennec development.
API DOCUMENTATION
API Documentation covers object internals. See the POD within each individual module.
AUTHORS
Chad Granum exodist7@gmail.com
COPYRIGHT
Copyright (C) 2010 Chad Granum
Fennec is free software; Standard perl licence.
Fennec is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.