-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathcoverage.cmd
32 lines (22 loc) · 847 Bytes
/
coverage.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@echo off
SETLOCAL
IF [%1]==[] SET SOLUTION_NAME=./src/Microsoft.Extensions.Logging.Log4net.sln
IF NOT [%1]==[] SET SOLUTION_NAME=%1
IF [%2]==[] SET TEST_PROJECT=./tests/Unit.Tests.Target.Netcore31/Unit.Tests.Target.Netcore31.csproj
IF NOT [%2]==[] SET TEST_PROJECT=%2
dotnet build-server shutdown
DEL .\TestResults /S /Q > NUL
ECHO Building %SOLUTION_NAME%...
dotnet build %SOLUTION_NAME%
ECHO Runing tests...
dotnet test /p:Language=cs ^
--no-build ^
/p:CollectCoverage=true ^
/p:CoverletOutputFormat=opencover ^
/p:CoverletOutput="%CD%/TestResults/" ^
%TEST_PROJECT%
ECHO Generating reports...
dotnet tool install -g dotnet-reportgenerator-globaltool > NUL
reportgenerator -reports:"%CD%/TestResults/*.xml" -targetdir:"%CD%/TestResults/reports" -reporttypes:HTML;HTMLSummary
TestResults\reports\index.htm
ENDLOCAL