Subject: | improve test coverage |
The mylib/coverage.perl utility will generate coverage reports for all or part of POE's tests.
1) poerbook:~/projects/poe/poe% perl mylib/coverage.perl t/10_units/05_filters/03_http.t
[...]
Reading database from /Users/troc/projects/poe/poe/cover_db
----------------------------------- ------ ------ ------ ------ ------ ------
File stmt branch cond sub time total
----------------------------------- ------ ------ ------ ------ ------ ------
lib/POE/Filter/HTTPD.pm 57.1 52.8 21.7 77.8 17.8 54.3
lib/POE/Macro/UseBytes.pm 100.0 50.0 n/a 100.0 0.5 95.2
lib/POE/Preprocessor.pm 56.3 50.0 n/a 73.7 67.9 55.5
t/10_units/05_filters/03_http.t 85.5 50.0 33.3 100.0 13.8 83.3
Total 64.4 50.6 23.1 81.6 100.0 61.5
----------------------------------- ------ ------ ------ ------ ------ ------
Writing HTML output to /Users/troc/projects/poe/poe/cover_db/coverage.html ...
done.
... then open cover_db/coverage.html to see what's missing. Edit, report, repeat. :)
Used without a parameter, coverage.perl will show the results for all of POE. It's a great way
to decide where to start writing tests.