Code coverage during CTFE
Stefan Frijters via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Feb 3 10:39:31 PST 2015
Recently I've hooked my code up to coveralls.io using the
convenient doveralls[1]. At first, I just did a dub test command
before sending the data to coveralls, but my simulation code also
has runnable tests in addition to unittests, which reaches many
more lines.
Today I've added an option to my testing script to merge the .lst
files from various runs, basically adding up the number of times
each line is hit. This seems to work just fine.
However, my code also heavily uses string mixins in a couple of
places, and I use functions that return the relevant strings to
generate them. These functions are never called at runtime, and
as such are shown with the nasty red bars for no coverage. Is it
possible to get a -cov dump for code run at compile time?
[1] https://github.com/ColdenCullen/doveralls
More information about the Digitalmars-d-learn
mailing list