| 1 | $testResults=Get-ChildItem TEST-TestSuite.xml -Recurse |
| 2 | |
| 3 | Write-Host "Uploading test results." |
| 4 | |
| 5 | $url = "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)" |
| 6 | $wc = New-Object 'System.Net.WebClient' |
| 7 | |
| 8 | foreach ($testResult in $testResults) { |
| 9 | try { |
| 10 | Write-Host -ForegroundColor Green "Uploading $testResult -> $url." |
| 11 | $wc.UploadFile($url, $testResult) |
| 12 | } catch [Net.WebException] { |
| 13 | Write-Host -ForegroundColor Red "Failed Uploading $testResult -> $url. $_" |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | Write-Host "Done uploading test results." |