NAME
Test::TestCoverage - see if all the unit tests are actually written
SYNOPSIS
# basic usage
use strict;
use Test::TestCoverage;
test_coverage_ok();
# if you also want to test files under lib/
use strict;
use Test::TestCoverage under qw(lib/);
test_coverage_ok();
# if you don't want to test some specific files
use strict;
use Test::TestCoverage;
test_coverage_ok except => qw(
t/todo/test.t
t/obsolete/.+ # you can use regex
)
DESCRIPTION
Say you are a project manager. You know what you have promised to deliver, and you know what should be tested. However, you are too busy to write all the tests by yourself. Then, why don't you write down what tests to be written as POD, and wait until someone implements all the details later?
As of this writing, this module slurps all the known (i.e. MANIFESTed) .t and .pm files under t/ (and xt/ if exists) directory by default, and if it finds head1
section(s) titled like Test(s)
, parses the following sections to find the names of the tests to be written, and then check the file again to see if the tests are actually implemented. If all the declared tests exist (as subroutines/methods), that's fine. If not, the test fails and you'll be informed what to write before you release.
In short, Test::TestCoverage is to write enough tests in the sense that Test::Pod::Coverage is to write enough pods.
Hope this helps.
EXPORTED FUNCTION
test_coverage_ok
Tests if all the tests files have the (unit) tests your declared in the POD.
SEE ALSO
Test::UseAllModules, Test::Pod::Coverage
AUTHOR
Kenichi Ishigaki, <ishigaki@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2011 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.