-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun.bat
83 lines (57 loc) · 4.31 KB
/
run.bat
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
rmdir /q /s target
mkdir target
set "opencover=%UserProfile%\.nuget\packages\opencover\4.7.1221\tools\OpenCover.Console.exe"
set "reportgenerator=%UserProfile%\.nuget\packages\reportgenerator\5.4.2\tools\net9.0\ReportGenerator.exe"
set "xunit=%UserProfile%\.nuget\packages\xunit.runner.console\2.9.2\tools\net48\xunit.console.exe"
set "dotnet=C:\Program Files\dotnet\dotnet.exe"
::%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .NET 4.7 - OpenCover %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
msbuild .\CoverageDemo.sln /v:m /t:Clean
rmdir /q /s BusinessTest_NetCore\bin
rmdir /q /s BusinessTest_NetCore\obj
msbuild .\CoverageDemo.sln /v:m /t:Restore
msbuild .\CoverageDemo.sln /v:m /t:Rebuild
set "targetdir=target\Net48_OpenCover"
mkdir %targetdir%
"%opencover%" -register:user "-target:%xunit%" -targetargs:"BusinessTest_Net48\bin\Debug\BusinessTest_Net48.dll -noshadow -xml %targetdir%\xunit.xml" -output:%targetdir%\coverage.xml -returntargetcode -coverbytest:* -mergebyhash
"%reportGenerator%" -reports:%targetdir%\coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir% -assemblyfilters:-xunit*
::%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .NET Core - OpenCover %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
msbuild .\CoverageDemo.sln /v:m /t:Clean
rmdir /q /s BusinessTest_NetCore\bin
rmdir /q /s BusinessTest_NetCore\obj
msbuild .\CoverageDemo.sln /v:m /t:Restore
msbuild .\CoverageDemo.sln /v:m /t:Rebuild
set "targetdir=target\NetCore_OpenCover"
mkdir %targetdir%
"%opencover%" -register:user "-target:%dotnet%" -targetargs:"test BusinessTest_NetCore\BusinessTest_NetCore.csproj" -output:%targetdir%\coverage.xml -returntargetcode -coverbytest:* -mergebyhash -oldstyle
"%reportGenerator%" -reports:%targetdir%\coverage.xml -reporttypes:HtmlInline -targetdir:%targetdir% -assemblyfilters:-xunit*;-AltCover*;-coverlet*;-FSharp.Core*;-Microsoft*;-testhost -classfilters:-AutoGeneratedProgram -riskhotspotassemblyfilters:-Microsoft*;-testhost
::%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .NET Core - Coverlet - msbuild %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
msbuild .\CoverageDemo.sln /v:m /t:Clean
rmdir /q /s BusinessTest_NetCore\bin
rmdir /q /s BusinessTest_NetCore\obj
msbuild .\CoverageDemo.sln /v:m /t:Restore
msbuild .\CoverageDemo.sln /v:m /t:Rebuild
set "targetdir=target\NetCore_Coverlet_msbuild"
mkdir %targetdir%
"%dotnet%" test --no-build /p:CollectCoverage=true /p:IncludeTestAssembly=true /p:CoverletOutputFormat=\"opencover,cobertura\" /p:CoverletOutput=../%targetdir%/ BusinessTest_NetCore\BusinessTest_NetCore.csproj
"%reportGenerator%" -reports:%targetdir%\coverage.opencover.xml -reporttypes:HtmlInline -targetdir:%targetdir% -assemblyfilters:-xunit* -classfilters:-AutoGeneratedProgram
::%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .NET Core - Coverlet - collector %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
msbuild .\CoverageDemo.sln /v:m /t:Clean
rmdir /q /s BusinessTest_NetCore\bin
rmdir /q /s BusinessTest_NetCore\obj
rmdir /q /s BusinessTest_NetCore\TestResults
msbuild .\CoverageDemo.sln /v:m /t:Restore
msbuild .\CoverageDemo.sln /v:m /t:Rebuild
set "targetdir=target\NetCore_Coverlet_collector"
mkdir %targetdir%
"%dotnet%" test --no-build --collect:"XPlat Code Coverage" BusinessTest_NetCore\BusinessTest_NetCore.csproj
"%reportGenerator%" -reports:BusinessTest_NetCore\TestResults\*\coverage.cobertura.xml -reporttypes:HtmlInline -targetdir:%targetdir% -assemblyfilters:-xunit* -classfilters:-AutoGeneratedProgram
::%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% .NET Core - AltCover %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
msbuild .\CoverageDemo.sln /v:m /t:Clean
rmdir /q /s BusinessTest_NetCore\bin
rmdir /q /s BusinessTest_NetCore\obj
msbuild .\CoverageDemo.sln /v:m /t:Restore
msbuild .\CoverageDemo.sln /v:m /t:Rebuild
set "targetdir=target\NetCore_AltCover"
mkdir %targetdir%
"%dotnet%" test --no-build /p:AltCover=true /p:AltCoverForce=true /p:AltCoverCallContext=[Fact] /p:AltCoverXmlReport=..\%targetdir%\coverage.opencover.xml /p:AltCoverCobertura=..\%targetdir%\coverage.cobertura.xml BusinessTest_NetCore\BusinessTest_NetCore.csproj
"%reportGenerator%" -reports:%targetdir%\coverage.cobertura.xml -reporttypes:HtmlInline -targetdir:%targetdir% -assemblyfilters:-xunit*;-AltCover*;-Microsoft*;-testhost -classfilters:-AutoGeneratedProgram -riskhotspotassemblyfilters:-Microsoft*;-testhost