Question

If I use opencover to provide coverage anaylsis that runs on the buildserver for all builds of my product.

I'm under the impression that opencover (and presumably all the others) "instrument" the code to record hits.

Is this instrumented code "not safe" and/or slower and therefore I should not be using this code on the production servers?

I'm hoping that I have misunderstood the process as the prospect of having to do 2 builds (1 for coverage testing and actual for production) will slow down the buildserver.

Was it helpful?

Solution

OpenCover (and NCover and PartCover) do not modify your binaries that you have produced via the build. They use the profiler API to instrument the binaries in-memory as they are being JITted (just-in-time compiled).

As such your binaries remain unmodified and are safe to use in production.

OTHER TIPS

I have running unit tests and openCover for multiples projects in Release mode (in a build machine). You do not need make this for Debug mode if you do not have code dependent of that mode (like pre-compiled directives etc.). I hope to help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top