@@ -5,13 +5,15 @@ mkdir "$env:APPVEYOR_BUILD_FOLDER\_Results" -ErrorAction SilentlyContinue
55$wc = New-Object System.Net.WebClient
66
77# run .net tests
8- $targetsDotNet = " net48;net472;net471;net47;net461;net45;net40;net35;net20 " -split " ;"
8+ $targetsDotNet = " net48;net472;net471;net47;net461;net45;net40" -split " ;"
99foreach ($target in $targetsDotNet ) {
1010 $logFileName = " $env: APPVEYOR_BUILD_FOLDER \_Results\$ ( $target ) _nunit_results.xml"
1111 $testAssemblies = (gci - include $include - r | `
1212 where { $_.fullname -match " \\bin\\Release\\$ ( $target ) " } | `
1313 select - ExpandProperty FullName)
1414
15+ echo " "
16+ echo " === $target ==="
1517 echo " nunit3-console $testAssemblies --result=$logFileName "
1618 & " nunit3-console" $testAssemblies " --result=$logFileName "
1719 if ($LastExitCode -ne 0 ) { $host.SetShouldExit ($LastExitCode ) }
@@ -24,6 +26,29 @@ foreach ($target in $targetsDotNet) {
2426 }
2527}
2628
29+ # run .net 2.x tests
30+ $targetsDotNet = " net35;net20" -split " ;"
31+ foreach ($target in $targetsDotNet ) {
32+ $logFileName = " $env: APPVEYOR_BUILD_FOLDER \_Results\$ ( $target ) _nunit_results.xml"
33+ $testAssemblies = (gci - include $include - r | `
34+ where { $_.fullname -match " \\bin\\Release\\$ ( $target ) " } | `
35+ select - ExpandProperty FullName)
36+
37+ echo " "
38+ echo " === $target ==="
39+ # HACK: see https://github.com/appveyor/ci/issues/3412 for details
40+ echo " nunit3-console $testAssemblies --result=$logFileName " " --framework=net-4.0"
41+ & " nunit3-console" $testAssemblies " --result=$logFileName " " --framework=net-4.0"
42+ if ($LastExitCode -ne 0 ) { $host.SetShouldExit ($LastExitCode ) }
43+
44+ echo " UploadFile: https://ci.appveyor.com/api/testresults/nunit3/$env: APPVEYOR_JOB_ID from $logFileName "
45+ $wc.UploadFile (" https://ci.appveyor.com/api/testresults/nunit3/$env: APPVEYOR_JOB_ID " , " $logFileName " )
46+ if ($LastExitCode -ne 0 ) {
47+ echo " FAIL: UploadFile: https://ci.appveyor.com/api/testresults/nunit3/$env: APPVEYOR_JOB_ID from $logFileName "
48+ $host.SetShouldExit ($LastExitCode )
49+ }
50+ }
51+
2752# run .net core tests
2853$targetsDotNetCore = " netcoreapp3.0;netcoreapp2.1;netcoreapp1.1" -split " ;"
2954foreach ($target in $targetsDotNetCore ) {
@@ -32,6 +57,8 @@ foreach ($target in $targetsDotNetCore) {
3257 where { $_.fullname -match " \\bin\\Release\\$ ( $target ) " } | `
3358 select - ExpandProperty FullName)
3459
60+ echo " "
61+ echo " === $target ==="
3562 echo " dotnet vstest $testAssemblies --logger:'trx;LogFileName=$logFileName '"
3663 dotnet vstest $testAssemblies -- logger:" trx;LogFileName=$logFileName "
3764 if ($LastExitCode -ne 0 ) { $host.SetShouldExit ($LastExitCode ) }
0 commit comments