Duncan Ferguson > Test-NoPlan-v0.0.6 > Test::NoPlan

Download:
Test-NoPlan-v0.0.6.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: v0.0.6   Source  

NAME ^

Test::NoPlan - check perl test files for 'no_plan'

SYNOPSIS ^

It is a good idea to ensure you have defined how many tests should be run within each test script - to catch cases where tests bomb out part way through so you know how many tests were not actually run. This module checks all your test plan files to ensure 'no_plan' is not used.

You can check one file:

    use Test::NoPlan qw/ check_file_for_no_plan /;
    use Test::More tests => 1;
    check_file_for_no_plan('t/test.t');

or check all files:

    use Test::NoPlan qw/ all_plans_ok /;
    all_plans_ok();

EXPORT ^

all_plans_ok({ options });

Searches for and checks *.t files within the current directory. Options (with defaults shown) are:

topdir => '.'

directory to begin search in - relative to the top directory in the project (i.e. where the Makefile.PL or Build.PL file is located)

check_files => qr/\.t$/xsm

Regexp used to identify files to check - i.e. files ending in '.t' - note, this just checks the basename of the files; the path is excluded.

ignore_files => qr/^\..*$/xsm

Regexp used to identify files to ignore - i.e. files starting with '.' - note, this just checks the basename of the files; the path is excluded.

recurse => 0

Recurse into any subdirectories - not done by default.

method => '<create|new>' [default: create]

Amend the method by which the test object is created. By default 'create' is used which is correct for tesst files containing only the 'all_plans_ok' test. If multiple tests are held within the same tesst file then 'new' should be used so a single test object is created and shared

get_file_list( { [ options ] } );

Return a list of files to be checked - uses same options as all_plans_ok

check_file_for_no_plan( $filename );

Check the given file for instances of uncommented 'no_plan' usage. Returns 0 for problem, 1 for no problem found.

AUTHOR ^

Duncan Ferguson, < duncs@cpan.org >

BUGS ^

Please report any bugs or feature requests to bug-test-noplan at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-NoPlan. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Test::NoPlan

You can also look for information at:

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENSE ^

Copyright 2009 Duncan Ferguson, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: