Skip to content
Permalink
Browse files

Changed OpenCover to use environment path

  • Loading branch information...
Turnerj committed Aug 7, 2019
1 parent b08d057 commit 1dd476125046c848052fc41fcce897773466d4cd
Showing with 4 additions and 1 deletion.
  1. +4 −1 build.ps1
@@ -16,6 +16,9 @@ Write-Host "Environment:" -ForegroundColor Cyan
Write-Host " .NET Version:" (dotnet --version)
Write-Host " Artifact Path: $packageOutputFolder"

# Initialise Path
$env:PATH += ";$env:LOCALAPPDATA\Apps\OpenCover\"

Write-Host "Building solution..." -ForegroundColor "Magenta"
dotnet build -c Release
if ($LastExitCode -ne 0) {
@@ -35,7 +38,7 @@ if ($RunTests -And -Not $CheckCoverage) {
}
elseif ($RunTests -And $CheckCoverage) {
Write-Host "Running tests with coverage..." -ForegroundColor "Magenta"
Invoke-Expression ("$env:LOCALAPPDATA\Apps\OpenCover\" + 'OpenCover.Console.exe -register:user -target:"%LocalAppData%\Microsoft\dotnet\dotnet.exe" -targetargs:"test tests/MongoFramework.Tests/MongoFramework.Tests.csproj /p:DebugType=Full" -filter:"+[MongoFramework]* -[MongoFramework.Tests]*" -output:"' + $packageOutputFolder + '\coverage.xml" -oldstyle')
OpenCover.Console.exe -register:user -target:"%LocalAppData%\Microsoft\dotnet\dotnet.exe" -targetargs:"test tests/MongoFramework.Tests/MongoFramework.Tests.csproj /p:DebugType=Full" -filter:"+[MongoFramework]* -[MongoFramework.Tests]*" -output:"$packageOutputFolder\coverage.xml" -oldstyle
if ($LastExitCode -ne 0 -Or -Not $?) {
Write-Host "Failure performing tests with coverage, aborting!" -Foreground "Red"
Exit 1

0 comments on commit 1dd4761

Please sign in to comment.
You can’t perform that action at this time.