www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - No code coverage for templated classes / methods?

reply Matthias Walter <walter mail.math.uni-magdeburg.de> writes:
Hello,

sorry for reposting this but I got no answer some time ago:

I've implemented an algorithm in D, using templates to achieve different
precisions (32bit, 64bit and arbitrary precision using GMP in the future).
Sadly, code coverage does not work for those (I've used Digital Mars D Compiler
v1.014) - all lines in the templated classes don't count as lines with
executable code :( Is it possible to change this behavior?

Any ideas whether I'm doing something wrong or this is not possible at all?

best regards
Matthias Walter
Jul 22 2007
parent reply Sean Kelly <sean f4.ca> writes:
Matthias Walter wrote:
 Hello,
 
 sorry for reposting this but I got no answer some time ago:
 
 I've implemented an algorithm in D, using templates to achieve different
 precisions (32bit, 64bit and arbitrary precision using GMP in the future).
 Sadly, code coverage does not work for those (I've used Digital Mars D Compiler
 v1.014) - all lines in the templated classes don't count as lines with
 executable code :( Is it possible to change this behavior?

If I had to guess, I would say this is related to the fact that template code cannot be debugged at the moment either. It's likely that certain debug information isn't currently being generated for template code.
 Any ideas whether I'm doing something wrong or this is not possible at all?

It's possible, just likely not supported yet. Sean
Jul 22 2007
parent reply novice2 <sorry noem.ail> writes:
sorry for offtopic.
btw, is there any method to see D code, generated by templates?
Jul 22 2007
parent reply Sean Kelly <sean f4.ca> writes:
novice2 wrote:
 sorry for offtopic.
 btw, is there any method to see D code, generated by templates?

Not that I know of. Sean
Jul 22 2007
parent Jari-Matti =?ISO-8859-1?Q?M=E4kel=E4?= <jmjmak utu.fi.invalid> writes:
Sean Kelly wrote:

 novice2 wrote:
 sorry for offtopic.
 btw, is there any method to see D code, generated by templates?

Not that I know of.

pragma(msg, ...), the typeinfo functions and .stringof may or may not help. Especially nested metastuff is a bit messy right now. Debugging string mixins is easier.
Jul 25 2007