Skip to content

Commit

Permalink
Merge pull request #2009 from ddur/stabilization
Browse files Browse the repository at this point in the history
opencover-report.bat to stabilization
  • Loading branch information
sharwell committed Dec 28, 2015
2 parents b279a88 + 8f45b81 commit 195031d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ packages/
*.suo
*.user
TestResults/
OpenCover.Reports/
.nuget/NuGet.exe
build/nuget/
*.log
Expand Down
2 changes: 2 additions & 0 deletions .nuget/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
<packages>
<package id="NuGet.CommandLine" version="2.8.3" />
<package id="OpenCover" version="4.6.247-rc" />
<package id="ReportGenerator" version="2.3.5.0" targetFramework="net452" />
<package id="xunit.runner.console" version="2.1.0" targetFramework="net452" />
</packages>
48 changes: 48 additions & 0 deletions opencover-report.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@set packages_folder=.\packages
@set opencover_console=%packages_folder%\OpenCover.4.6.247-rc\tools\OpenCover.Console.exe
@set xunit_runner_console=%packages_folder%\xunit.runner.console.2.1.0\tools\xunit.console.x86.exe
@set report_generator=%packages_folder%\ReportGenerator.2.3.5.0\tools\ReportGenerator.exe
@set report_folder=.\OpenCover.Reports
@set target_dll=.\StyleCop.Analyzers\StyleCop.Analyzers.Test\bin\Debug\StyleCop.Analyzers.Test.dll
@if not exist %target_dll% goto error_target_dll
@if not exist %opencover_console% goto error_opencover_console
@if not exist %xunit_runner_console% goto error_xunit_runner_console
@if not exist %report_generator% goto error_report_generator

@if exist %report_folder%\. (del /Q %report_folder%\*) else (md %report_folder%)
@%opencover_console% ^
-register:user ^
-threshold:1 ^
-returntargetcode ^
-hideskipped:All ^
-filter:"+[StyleCop*]*" ^
-excludebyattribute:*.ExcludeFromCodeCoverage* ^
-output:"%report_folder%\OpenCover.StyleCopAnalyzers.xml" ^
-target:"%xunit_runner_console%" ^
-targetargs:"%target_dll% -noshadow"

@%report_generator% -targetdir:%report_folder% -reports:%report_folder%\OpenCover.*.xml

@goto end

:error_target_dll
@echo target dll not found (build target?)
@echo %target_dll%
@goto end

:error_opencover_console
@echo OpenCover Console not found (nuget restore?)
@echo %opencover_console%
@goto end

:error_xunit_runner_console
@echo OpenCover Console not found (nuget restore?)
@echo %xunit_runner_console%
@goto end

:error_report_generator
@echo Report Generator not found (nuget restore?)
@echo %report_generator%
@goto end

:end

0 comments on commit 195031d

Please sign in to comment.