How can I do code coverage on those applications compiled by unity3d

Now I’m tending to know how many code are tested on Android. But the situation is that almost all of C# coverage tools(NCover,OpenCover, etc.) were run on Windows and they don’t need to instrument code. That is the reason why I couldn’t instrument them and run the application on android.
Is it possible to make some mono addons to instrument codes when unity3D compiling the C#?
BUT I don’t know what’s the way that Unity3D calls mono and the version of mono Unity3D used.

Did you ever get anywhere with this?

noop~But I found that those c# script were compiled into a dll called Assembly-CSharp.dll @bill-4

2 Answers

2

It looks like this might be currently possible on windows, I don’t know if it will work for the Android target though:

However, there is an open feature request for Unity to add a test coverage report. Please support this idea by voting on it! I don’t know if that proposal, as it stands, would help this particular situation however.

You can use the Code Coverage package available in 2019.3. For more information see the official forum post here https://forum.unity.com/threads/code-coverage-package-preview.777542/