Last active
November 27, 2018 23:14
-
-
Save juanluelguerre/b276fb6c20287019647fc56b94956698 to your computer and use it in GitHub Desktop.
Runing Tests & CodeCoverage without Visual Studio
This file contains 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
@echo off | |
SETLOCAL | |
IF [%1]==[] SET SOLUTION_NAME=ElGuerre.Taskin.Api.sln | |
IF NOT [%1]==[] SET SOLUTION_NAME=%1 | |
IF [%2]==[] SET TEST_PROJECT=./test/ElGuerre.Taskin.Api.Tests/ElGuerre.Taskin.Api.Tests.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 > NUL | |
TestResults\reports\index.htm | |
ENDLOCAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment