-
Notifications
You must be signed in to change notification settings - Fork 35
/
CodeJam.AppVeyor.NUnit.Tests.ps1
23 lines (20 loc) · 1.13 KB
/
CodeJam.AppVeyor.NUnit.Tests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$include = "*-tests.dll", "*-tests.performance.dll", "*-tests.NUnit.dll"
$exclude = "Experimental\\.*?\\CodeJam-Tests.Performance.dll"
#run .net tests
$a = (gci -include $include -r | `
where { $_.fullname -match "\\bin\\Publish\\net\d" -and $_.fullname -notmatch $exclude } | `
select -ExpandProperty FullName)
echo "nunit3-console $a --result=myresults.xml;format=AppVeyor"
&"nunit3-console" $a "--result=myresults.xml;format=AppVeyor"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
#run .net core tests
$a = (gci -include $include -r | `
where { $_.fullname -match "\\bin\\Publish\\netcore" -and $_.fullname -notmatch $exclude } | `
select -ExpandProperty FullName)
$logFileName = "$env:APPVEYOR_BUILD_FOLDER\_Results\netcore_nunit_results.xml"
echo "dotnet vstest $a --logger:'trx;LogFileName=$logFileName'"
dotnet vstest $a --logger:"trx;LogFileName=$logFileName"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
$wc = New-Object System.Net.WebClient
$wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$env:APPVEYOR_JOB_ID", "$logFileName")
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }