www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - compile time coverage: dmd -staticcov

reply "timotheecour" <timothee.cour2 gmail.com> writes:
Why not have a -staticcov (or -ctcov) flag to dmd that produces 
compile time code coverage?
This will work for most code (with the exception of virtual 
methods called from a base class -- anything else?): it'll just 
produce 1 or 0 depending for each line compiled in, depending on 
whether it's reachable from main file.

Likewise, with the recent addition of minimal code coverage for 
unittest we could have:

dmd -cov=83 -unittest -main -run std/file.d
dmd -staticcov=83 -unittest -main -run std/file.d

Further enhancements: compile time caller/callee graph.

Thanks for your feedback!
Mar 18 2013
parent "bearophile" <bearophileHUGS lycos.com> writes:
timotheecour:

 Why not have a -staticcov (or -ctcov) flag to dmd that produces 
 compile time code coverage?
This seems a note fit to be added to this: http://d.puremagic.com/issues/show_bug.cgi?id=9721 Bye, bearophile
Mar 18 2013