Created
March 4, 2019 13:43
-
-
Save samuell/d5b5dc9d76d1d9314b39ea75f4b86edb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# --------------------------------------------------------------------- | |
# Generate test coverage for .Net core 2 projects. | |
# --------------------------------------------------------------------- | |
# Author: Samuel Lampa | |
# | |
# This script is supposed to be run in a Windows bash-environment such | |
# as MSYS2 (See this post for a guide on how to set up one: | |
# https://bionics.it/posts/linux-like-non-wsl-terminal-env-on-windows) | |
# | |
# Requires that you first install: | |
# - CoverLet https://github.com/tonerdo/coverlet (NuGet | |
# - ReportGenerator https://github.com/danielpalme/ReportGenerator | |
# ... and make sure they are available in your $PATH variable. | |
# --------------------------------------------------------------------- | |
dotnet build | |
coverlet ./bin/Debug/netcoreapp2.1/[YourPackage].dll --target dotnet --targetargs "test --no-build" --format opencover; | |
/c/Users/$USER/.nuget/packages/reportgenerator/4.0.14/tools/net47/ReportGenerator.exe "-reports:coverage.opencover.xml" "-targetdir:covreport"; | |
echo "Now trying to open the report in the Brave browser (if it doesn't work, you probably don't have Brave installed)"; | |
/c/Program\ Files\ \(x86\)/BraveSoftware/Brave-Browser/Application/brave.exe covreport/index.htm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment