BioPerl-Network
view release on metacpan or search on metacpan
t/lib/Test/Harness.pm view on Meta::CPAN
=over 4
=item C<HARNESS_COLUMNS>
This value will be used for the width of the terminal. If it is not
set then it will default to C<COLUMNS>. If this is not set, it will
default to 80. Note that users of Bourne-sh based shells will need to
C<export COLUMNS> for this module to use that variable.
=item C<HARNESS_COMPILE_TEST>
When true it will make harness attempt to compile the test using
C<perlcc> before running it.
B<NOTE> This currently only works when sitting in the perl source
directory!
=item C<HARNESS_DEBUG>
If true, Test::Harness will print debugging information about itself as
it runs the tests. This is different from C<HARNESS_VERBOSE>, which prints
the output from the test being run. Setting C<$Test::Harness::Debug> will
override this, or you can use the C<-d> switch in the F<prove> utility.
=item C<HARNESS_FILELEAK_IN_DIR>
When set to the name of a directory, harness will check after each
test whether new files appeared in that directory, and report them as
LEAKED FILES: scr.tmp 0 my.db
If relative, directory name is with respect to the current directory at
the moment runtests() was called. Putting absolute path into
C<HARNESS_FILELEAK_IN_DIR> may give more predictable results.
=item C<HARNESS_NOTTY>
When set to a true value, forces it to behave as though STDOUT were
not a console. You may need to set this if you don't want harness to
output more frequent progress messages using carriage returns. Some
consoles may not handle carriage returns properly (which results in a
somewhat messy output).
=item C<HARNESS_PERL>
Usually your tests will be run by C<$^X>, the currently-executing Perl.
However, you may want to have it run by a different executable, such as
a threading perl, or a different version.
If you're using the F<prove> utility, you can use the C<--perl> switch.
=item C<HARNESS_PERL_SWITCHES>
Its value will be prepended to the switches used to invoke perl on
each test. For example, setting C<HARNESS_PERL_SWITCHES> to C<-W> will
run all tests with all warnings enabled.
=item C<HARNESS_TIMER>
Setting this to true will make the harness display the number of
milliseconds each test took. You can also use F<prove>'s C<--timer>
switch.
=item C<HARNESS_VERBOSE>
If true, Test::Harness will output the verbose results of running
its tests. Setting C<$Test::Harness::verbose> will override this,
or you can use the C<-v> switch in the F<prove> utility.
If true, Test::Harness will output the verbose results of running
its tests. Setting C<$Test::Harness::verbose> will override this,
or you can use the C<-v> switch in the F<prove> utility.
=item C<HARNESS_STRAP_CLASS>
Defines the Test::Harness::Straps subclass to use. The value may either
be a filename or a class name.
If HARNESS_STRAP_CLASS is a class name, the class must be in C<@INC>
like any other class.
If HARNESS_STRAP_CLASS is a filename, the .pm file must return the name
of the class, instead of the canonical "1".
=back
=head1 EXAMPLE
Here's how Test::Harness tests itself
$ cd ~/src/devel/Test-Harness
$ perl -Mblib -e 'use Test::Harness qw(&runtests $verbose);
$verbose=0; runtests @ARGV;' t/*.t
Using /home/schwern/src/devel/Test-Harness/blib
t/base..............ok
t/nonumbers.........ok
t/ok................ok
t/test-harness......ok
All tests successful.
Files=4, Tests=24, 2 wallclock secs ( 0.61 cusr + 0.41 csys = 1.02 CPU)
=head1 SEE ALSO
The included F<prove> utility for running test scripts from the command line,
L<Test> and L<Test::Simple> for writing test scripts, L<Benchmark> for
the underlying timing routines, and L<Devel::Cover> for test coverage
analysis.
=head1 TODO
Provide a way of running tests quietly (ie. no printing) for automated
validation of tests. This will probably take the form of a version
of runtests() which rather than printing its output returns raw data
on the state of the tests. (Partially done in Test::Harness::Straps)
Document the format.
Fix HARNESS_COMPILE_TEST without breaking its core usage.
Figure a way to report test names in the failure summary.
( run in 1.805 second using v1.01-cache-2.11-cpan-39bf76dae61 )