NAME
Test::Tester - extends the capabilites of the Test module
SYNOPSIS
use Test::Tester
$T = new Test::Tester;
$success = $T->work_breakdown(@args);
$test_ok = $T->test(\@actual_results, \@expected_results, $test_name);
$test_ok = $T->verify(test, \@actual_results, \@expected_results, $test_name);
$success = $T->skip_rest();
$success = $T->finish( );
$success = $T->demo( $quoted_expression, @expression_results );
DESCRIPTION
The Test::Tester module extends the capabilities of the Test module as follows:
Compare almost any data structure by passing variables through Data::Dumper before making the comparision
Method to skip the rest of the tests upon a critical failure
Method to generate demos that appear as an interactive session using the methods under test
The Test::Tester module is an integral part of the US DOD SDT2167A bundle of modules. The dependency of the program modules in the US DOD STD2167A bundle is as follows:
Test::TestUtil
Test::Tester
DataPort::FormDB
Test::STDmaker ExtUtils::SVDmaker
new method
$T = new Test::Tester;
The new method creates a new Test::Tester object.
work_breakdown method
$success = $T->work_breakdown(@args);
The work_breakdown method is a cover method for &Test::plan. The @args are passed unchanged directory to &Test::plan. All arguments are options. Valid options are as follows:
- tests
-
The number of tests. For example
tests => 14,
- todo
-
An array of test that will fail. For example
todo => [3,4]
- onfail
-
A subroutine that the Test module will execute on a failure. For example,
onfail => sub { warn "CALL 911!" }
test method
$test_ok = $T->test(\@actual_results, \@expected_results, $test_name);
The test method is a cover function for the &Test::ok subroutine that extends the &Test::ok routine as follows:
Prints out the $test_name to provide an English identification of the test.
The test method passes the arrays @actual_results and @expectet_results through &Data::Dumper::Dumper. The test method then uses &Test::ok to compare the text results from &Data::Dumper::Dumper.
Response to a flag set by the skip_rest method and skips the test completely.
verify method
$test_ok = $T->verify(test, \@actual_results, \@expected_results, $test_name);
The test method is a cover function for the &Test::skip subroutine that extends the &Test::skip the same as the test method extends the &Test::ok subroutine. See test method
skip_rest method
$success = $T->skip_rest();
The skip_rest method sets a flag that causes the test and the verify methods to skip testing.
finish method
$success = $T->finish( );
The finish method shuts down the $T Test::Tester object.
head2 Test::TestUtil methods
The Test::Tester program module inherits all the methods from the Test::TestUtil module.
NOTES
AUTHOR
The holder of the copyright and maintainer is
<support@SoftwareDiamonds.com>
COPYRIGHT NOTICE
Copyrighted (c) 2002 Software Diamonds
All Rights Reserved
BINDING REQUIREMENTS NOTICE
Binding requirements are indexed with the pharse 'shall[dd]' where dd is an unique number for each header section. This conforms to standard federal government practices, 490A ("3.2.3.6" in STD490A). In accordance with the License, Software Diamonds is not liable for any requirement, binding or otherwise.
LICENSE
Software Diamonds permits the redistribution and use in source and binary forms, with or without modification, provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
SOFTWARE DIAMONDS, http::www.softwarediamonds.com, PROVIDES THIS SOFTWARE 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTWARE DIAMONDS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING USE OF THIS SOFTWARE, EVEN IF ADVISED OF NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE POSSIBILITY OF SUCH DAMAGE.
SEE ALSO