Subject: | Auto-detect when to rebuild cover_db files when .pm files change |
I use Devel::Cover via the Module::Build testcover action. However, when I change my .pm files and re-run, Devel::Cover gets very confused about line numbers, as it caches lots of information about the previous version of the .pm files.
I propose that Devel::Cover keep a timestamp or checksum of each .pm that has been profiled. When that indicator changes for the live .pm file, Devel::Cover should expunge all profile information about that file from the cover_db. Perhaps the entire cover_db should be deleted, since interactions between the modules could cause old data to be invalid (e.g. if the API changes in a dependent module).
As a workaround, I've submitted a bug to Module::Build to auto-delete the cover_db directory if any .pm files have changed, but it would be better if Devel::Cover tried to do this by itself.
-- Chris