Extending HPC to indicate functions, expressions to ignore
HPC reports some elements as not tested, even though we can reasonably assume that they'll be correct.
For example, constructors and record fields all generate functions that HPC reports as not tested, even though there's a reasonable expectation that they'll be correct by construction.
A similar thing happens with types like Proxy
, whose values are not needed at runtime.
Lazy functions fall into the same category, and it especially affects uses of dependent types, where an argument can be safely ignored because only the type information is needed.
To make HPC report full coverage for these elements, we'd need to create dummy tests (in the first case) or seq
values unnecessarily (in the second case).
I'd be great if we could instruct HPC to ignore certain functions and values, either locally in a portion of the code or altogether across a codebase.
Although one can always manually modify the tix/mix files, it's more portable / less hacky if this is handled by HPC.
A reference library for which this is happening is copilot-core, and, specifically:
The Copilot.Core.{Expr,Operator,Spec}
modules only contain datatypes.
The function fieldName is lazy in its arguments and uses a Proxy internally. Both the argument and the Proxy are marked as unevaluated, and uses of fieldName across the codebase report that the argument is not evaluated.