Nim Code Coverage

1 · Dennis Felsing · Oct. 31, 2016, 11 p.m.
Creating code coverage reports with Nim is surprisingly easy. You can simply use the good old gcov and lcov tools. Nim can be told to insert its own line information with the --debugger:native command line parameter. Here’s the small example program we’re looking at: var x = 0 if x > 1: echo "foo" echo "bar" Note that if we change the condition to if false: the Nim compiler optimizes the impossible code away and it will not count as uncovered. The same thing can happen with entire uncovered f...