Bug 9721 – Code coverage for templates

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-14T09:30:28Z
Last change time
2024-12-13T18:04:54Z
Assigned to
No Owner
Creator
simendsjo
See also
https://issues.dlang.org/show_bug.cgi?id=14825
Moved to GitHub: dmd#18537 →

Comments

Comment #0 by simendsjo — 2013-03-14T09:30:28Z
Ref.: http://forum.dlang.org/thread/[email protected] Is there a way to get code coverage functionality for templates to see what parts of templates are instantiated? t.d: module t; template t(T) { static if(is(T == int)) alias int t; else static if(is(T == short)) alias short t; } unittest { t!int a = 10; assert(a == 10); } void main() {} $ dmd -unittest -cov -run t t.lst: | module t; | template t(T) { | static if(is(T == int)) | alias int t; | else static if(is(T == short)) | alias short t; | } | unittest { 1| t!int a = 10; 1| assert(a == 10); | } | void main() {} t.d is 100% covered
Comment #1 by thelastmammoth — 2013-03-18T14:29:52Z
Comment #2 by code — 2015-04-19T17:39:33Z
We can't merge this with the existing coverage, it's more like a -staticcov. Seems pretty complex for what it achieves.
Comment #3 by robert.schadek — 2024-12-13T18:04:54Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18537 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB