The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Helper - easy creation of test scripts

SYNOPSIS

 use Test::Helper;
 test {
   comm 'Doing first part of test';
   ok $variable==$correct_value;
   ok not runs {this_should_die()};
 };

DESCRIPTION

Enclose the body of your test script within a test block. Within that block, run individual tests with the ok function, which should be passed a scalar that you desire to be true; this will print "ok number" or "not ok number" as appropriate. Similarly, the runs command will expect its body not to signal an error when run; use it with ok, negated or not. Note that the test block keeps track of how many tests there are and outputs the first line accordingly (it stores up the messages); if an uncaught exception is raised within the body, it simulates one last failed test and propagates the exception in order to ensure that it is counted as a failure. comm just writes out a comment to the standard output where it will be visible in verbose testing mode. syntax_check checks the syntax of modules and scripts listed in the MANIFEST.

SEE ALSO

See Test::Harness(3), for how test scripts are run; and ExtUtils::MakeMaker(3), for where to put test scripts (usually as files t/*.t) in a distribution.

AUTHORS

Jesse Glick, jglick@sig.bsh.com

REVISION

Test-Helper/lib/Test/Helper.pm last modified Fri, 05 Sep 1997 16:08:15 -0400. Release 0.002. Copyright (c) 1997 Strategic Interactive Group. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.