coverlet
coverlet copied to clipboard
Don't track branch coverage for Debug.Assert
E.g. https://ci.dot.net/job/dotnet_corefx/job/master/job/code_coverage_windows/Code_Coverage_Report/System.Collections_BitArray.htm
Doesn't seem very useful as we don't expect this to happen
The whole System.Diagnostics.Debug type can be excluded with the --exclude
switch. We can definitely do that in corefx but I'm not sure if @tonerdo wants that set globally.
I'm adding /P:Exclude="[*]System.Diagnostics.Debug"
but doesn't seem to work - doesn't exclude mean "don't check coverage for this class" rather than "don't check anything calling this class"?
Oh you are right but wouldn't/shouldn't a) also imply b)?
Apparently not!
Excluding a class means that non of the methods belonging to that class are instrumented. It's a non-trivial amount of work to have that exclusion rule apply the usages of the class itself
I also encountered this problem.
Hi folks. This is not an issue with Debug.Assert
at all. The issue is &&
operator inside it. You can switch &&
to &
to get full coverage. Confirmed here https://github.com/graphql-dotnet/parser/pull/242