File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,20 @@ Get-ChildItem -Recurse -Filter "*Tests.csproj" -Path . | ForEach-Object {
1919
2020 foreach ($fw in $frameworks ) {
2121 Write-Host " Running $projName [$fw ]" - ForegroundColor Cyan
22- dotnet run -- project $proj -- configuration Release -- framework $fw -- no- build
23- if ($LASTEXITCODE -ne 0 ) { throw " Tests failed for $projName [$fw ]" }
22+ $trxName = " $ ( $projName -replace ' \.csproj$' , ' ' ) _${fw} .trx"
23+ $trxDir = Join-Path $PSScriptRoot " TestResults"
24+ dotnet run -- project $proj -- configuration Release -- framework $fw -- no- build -- -- report- trx -- report- trx- filename $trxName -- results- directory $trxDir
25+ $testExitCode = $LASTEXITCODE
26+
27+ if ($env: APPVEYOR_JOB_ID ) {
28+ $trxFile = Join-Path $trxDir $trxName
29+ if (Test-Path $trxFile ) {
30+ Write-Host " Uploading $trxName to AppVeyor" - ForegroundColor Green
31+ $wc = New-Object ' System.Net.WebClient'
32+ $wc.UploadFile (" https://ci.appveyor.com/api/testresults/mstest/$ ( $env: APPVEYOR_JOB_ID ) " , $trxFile )
33+ }
34+ }
35+
36+ if ($testExitCode -ne 0 ) { throw " Tests failed for $projName [$fw ]" }
2437 }
2538}
You can’t perform that action at this time.
0 commit comments