NAME
Fennec - Full Featured Testing Toolbox And Development Kit
DESCRIPTION
Fennec is a full featured testing toolbox. Fennec provides all the tools your used to, but in a framework that allows for greater interopability of third party tools. Along with the typical set of tools, Fennec addresses many common problems, complaints, and wish list items.
In addition to the provided tools, Fennec provides a solid framework and highly extendable API. Using Fennec you can write custom workflows, assertions, testers, and output plugins. You can even define custom file types and file loaders.
SYNOPSIS
package TEST::MyModule;
use strict;
use warnings;
use Fennec::Standalone;
use_or_skip 'Dependancy::Module';
use_ok 'MyModule';
tests simple {
can_ok( 'MyModule', 'new' );
isa_ok( MyModule->new(), 'MyModule' );
dies_ok { MyModule->Thing_that_dies } "thing dies";
warning_like { MyModule->Thing_that_warns } qr/.../, "thing warns";
is_deeply( ... );
...
}
describe 'RSPEC Tests' {
# Automatically get $self
before_each { $self->do_something }
after_each { $self->do_something_else }
it test_one {
ok( 1, "1 is true!" )
}
describe { ... };
}
cases some_primes {
my $var;
case two { $var = 2 };
case three { $var = 3 };
tests is_prime {
ok( is_prime($var), "var is prime" )
};
}
1;
FURTHER READING
- Fennec::Manual::Tests
-
Primer on Fennec's core tools
- Fennec::Manual::TestSuite
-
Writing standalone tests that exist isolated in .t files.
- Fennec::Manual::Standalone
-
Using Fennec as a runner to better manage your test suite.
FEATURES
Fennec offers the following features, among others.
- Declarative syntax
-
Fennec uses Devel::Declare via Exporter::Declare to provide a nice, clean declarative syntax.
- Large library of core test functions
- Plays nicely with Test::Builder tools
- Better diagnostics
-
No STDERR and STDOUT disconnect between a failure and its output. If a tool does not provide helpful output Fennec tries to give you some anyway.
- Highly Extendable
-
Thats the goal
- Lite benchmarking for free
-
Time between results in each process is timed.
- Works with prove
-
t/Fennec.t as a runner, or Fennec::Standalone
- Full-Suite management
- Standalone test support
- Support for SPEC and other test workflows
- Forking works
-
Results are process-aware, no mangled test numbers.
- Run only specific test sets within test files (for development)
-
Don't run an entire test file to debug a single section
- Intercept or hook into most steps or components by design
-
No limits.
- No large dependancy chains
-
Mostly core dependancies, only a couple cpan modules.
- No attributes
-
By attrivutes we mean: http://perldoc.perl.org/attributes.html
- No use of END blocks
-
Thar be dragons.
- No use of Sub::Uplevel
-
Known to cause problems with Carp, Test::Exception, and others.
- No source filters
-
Never.
FENNEC DEVELOPER DOCUMENTATION
- MISSION
-
Fennec::Manual::Mission - Why does Fennec exist?
- MANUAL
-
Fennec::Manual - Advanced usage and extending Fennec.
MODULE API
This section only covers the API for Fennec.pm. See Fennec::Manual and other documentation for other module API's.
This section is not for those who simply wish to write tests, this is for people who want to extend Fennec.
Class methods
- import( %proto )
-
use Fennec %proto;
Called when you use the Fennec module. %proto is key/value pairs for configuration and/or test class meta data. Meta data keys may be mixed in or placed in a hashref under the 'meta' key.
- my $obj = $class->new( %proto )
-
Create a new instance. %proto can be all the same key/value pairs as import(), except that the meta data must be in a hashref under the 'meta' key. You must also specify a 'caller' key with an arrayref containing a package name, filename, and line number for the test file.
Object methods
When you use Fennec, it will create an object internally to do some initialization and exporting. These are it's methods.
- test_class()
-
Returns the test class. This will either be determined by import() or provided to import/new via the first element of the arrayref provided under the 'caller' key.
- test_file()
-
Returns the test filename. This will either be determined by import() or provided to import/new via the second element of the arrayref provided under the 'caller' key.
- imported_line()
-
Returns the line number where fennec was used. This will either be determined by import() or provided to import/new via the third element of the arrayref provided under the 'caller' key.
- workflows()
-
Returns an arrayref containing the workflow names provided at import, or if none were provided, then the defaults will be provided.
- asserts()
-
Returns an arrayref containing the assert names provided at import, or if none were provided, then the defaults will be provided.
- root_workflow()
-
Returns the classname of the root workflow that will be used.
- subclass()
-
Modifies the test classes @ISA array to make it a subclass of Fennec::TestFile
- init_meta()
-
Initializes the meta object for the test class.
- export_tools()
-
Export the basic tools to the test class
- export_workflows()
-
Export the desired workflows to the test class
- export_asserts()
-
Export the desired asserts to the test class
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.