Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script for generating test coverage reports
The script runs the unit tests via OpenCover, which also generates a report in XML format. Then some HTML files are generated by parsing the XML file, which are then served by `dotnet serve` tool. The script is pretty self-explanatory. It depends on a few CLI tools: xUnit, OpenCover (portable), codecov. These are available on Chocolatey. It also requires a .NET Core global tool (which can be installed via .NET Core CLI): `dotnet-reportgenerator-globaltool`. These are explained in the script in the comments at the top. The script is, unfortunately, for Windows only. This is due to OpenCover being available only for Windows. I have tried some cross-platform coverage tools (for example, @coverlet-coverage), but was not satisfied. The problem with Coverlet is that after generating coverage for tests covering multiple namespaces, it calculates the coverage by calculating the simple arithmetic mean — not a weighted arithmetic mean, which would take the number of LOC of each namespace into account.
- Loading branch information