www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Do you want support for CTFE coverage ?

reply Stefan Koch <uplink.coder googlemail.com> writes:
Hi,

Exactly as per title.
Do you want to see coverage for code executed at CTFE ?

I ask because it is slightly tricky to support this and it needs 
to be factored in early in design.

And please off-topic or thread hijacking this time.

Thanks!
Jul 01 2016
next sibling parent ketmar <ketmar ketmar.no-ip.org> writes:
there is no need in that, absolutely. CTFE is undebugabble anyway 
(and pragma(msg) not really helps -- i'm saying that as a fan of 
printf debugger), unittesting it is silly and so on.

after all, as CTFE *should* behave the same if it is done in 
runtime, one can always test and debug CTFE code as "normal" code 
before using.

so, i say: "don't bother".
Jul 01 2016
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 7/1/2016 1:29 PM, Stefan Koch wrote:
 Do you want to see coverage for code executed at CTFE ?
It's not necessary since CTFE code can all be executed at runtime, and coverage tested that way.
Jul 01 2016
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Saturday, 2 July 2016 at 00:34:05 UTC, Walter Bright wrote:
 On 7/1/2016 1:29 PM, Stefan Koch wrote:
 Do you want to see coverage for code executed at CTFE ?
It's not necessary since CTFE code can all be executed at runtime, and coverage tested that way.
Fair enough :) execpt for code guarded by if (__ctfe)
Jul 01 2016
parent Basile B. <b2.temp gmx.com> writes:
On Saturday, 2 July 2016 at 00:38:56 UTC, Stefan Koch wrote:
 On Saturday, 2 July 2016 at 00:34:05 UTC, Walter Bright wrote:
 On 7/1/2016 1:29 PM, Stefan Koch wrote:
 Do you want to see coverage for code executed at CTFE ?
It's not necessary since CTFE code can all be executed at runtime, and coverage tested that way.
Fair enough :) execpt for code guarded by if (__ctfe)
What I'd like is that the code inside 'if(__ctfe)' branches gets ignored in the coverage results, so that 100% can be reached. for normal CTFE, to use assert() instead of static assert() does the trick.
Jul 01 2016