
Test::TestCoverage - Test if your test covers all "public" subroutines of the package

use Test::TestCoverage;
test_coverage('My::Module');
my $obj = My::Module->new();
$obj->foo();
$obj->bar();
# test will be ok, assumed that My::Module has the subroutines new, foo and bar
ok_test_coverage('My::Module');
reset_test_coverage('My::Module');
reset_all_test_coverage();
test_coverage('My::Module');
my $obj = My::Method->new();
$obj->foo();
# test will be not ok, because bar is not invoked
ok_test_coverage('My::Module');
reset_test_coverage('My::Module');
reset_all_test_coverage();
test_coverage('My::Module');
test_coverage_except('My::Module','bar');
my $obj = My::Method->new();
$obj->foo();
# test will be ok, because bar is excepted of test
ok_test_coverage('My::Module');

If a module is written, the tests cover just a few subroutines of the module. This module aims to support the author in writing "complete" tests. If one of the "public" subroutines are missed in the testscript, the test ok_test_coverage will fail.
"private" subroutines are defined as subroutines that names begin with _ like _private_sub{...} and "public" is the opposite.

Tells Test::TestCoverage for what module the coverage should be tested
Checks if all "public" subroutines of $module were called in the testscript
Resets the counter for all method invokations of $module's subroutines.
Resets the counter for all subroutines of all modules that were registerd via test_coverage.
Test all "public" subroutines of $module except the subroutines named in the array.
tests the test coverage for each registered module.

test_coverage, ok_test_coverage, reset_test_coverage, reset_all_test_coverage, test_coverage_except

Test::SubCalls, Test::Builder, Test::More, Devel::Cover

There are a lot of things to do. If you experience any problems please contact me. At the moment the subroutines have to be invoked with full qualified names. Exported subroutines are not detected.

Renee Baecker, <module@renee-baecker.de>

Copyright (C) 2006 by Renee Baecker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.