Browse Source

ensure error code from tests is handled

Oren Novotny 8 years ago
parent
commit
cf39d59cf5
1 changed files with 10 additions and 10 deletions
  1. 10 10
      Rx.NET/Source/build-new.ps1

+ 10 - 10
Rx.NET/Source/build-new.ps1

@@ -82,13 +82,18 @@ else
 {
 	$dotnet = "$env:ProgramFiles\dotnet\dotnet.exe"
 	#.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="c:\program files\dotnet\dotnet.exe" /targetworkingdir=".\Tests.System.Reactive" /targetarguments="test --no-build --filter:SkipCI!=true" /output=.\testResults.dvcr /Filters="+:module=System.Reactive;+:module=Microsoft.Reactive.Testing;+:module=System.Reactive.Observable.Aliases;-:type=Xunit*" /DisableDefaultFilters
-	.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe analyze /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test --no-build --filter:SkipCI!=true" /ReportType=DetailedXML /output=$outputFile /Filters="+:module=System.Reactive;+:module=Microsoft.Reactive.Testing;+:module=System.Reactive.Observable.Aliases;-:type=Xunit*" /DisableDefaultFilters /HideAutoProperties
+	.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe analyze /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test --no-build --filter:SkipCI!=true" /ReportType=DetailedXML /output="$outputFile" /Filters="+:module=System.Reactive;+:module=Microsoft.Reactive.Testing;+:module=System.Reactive.Observable.Aliases;-:type=Xunit*" /DisableDefaultFilters /HideAutoProperties /ReturnTargetExitCode
 
-	 .\packages\ReportGenerator\tools\ReportGenerator.exe -reports:"$outputFile" -targetdir:"$outputPath"
-     &$outPutPath/index.htm
+	.\packages\ReportGenerator\tools\ReportGenerator.exe -reports:"$outputFile" -targetdir:"$outputPath"
+    &"$outPutPath/index.htm"
 }
 
-
+if ($LastExitCode -ne 0) { 
+    Write-Host "Error with tests" -Foreground Red
+    if($isAppVeyor) {
+      $host.SetShouldExit($LastExitCode)
+    }  
+}
 
 # We bail out here because OpenCover isn't properly reporting coverage 
 exit
@@ -96,12 +101,7 @@ exit
 # Execute OpenCover with a target of "dotnet test"
 # & $openCoverPath -register:user -oldStyle -mergeoutput -target:dotnet.exe -targetdir:"$testDirectory" -targetargs:"test --no-build --filter:SkipCI!=true" -output:"$outputFile" -skipautoprops -returntargetcode -excludebyattribute:"System.Diagnostics.DebuggerNonUserCodeAttribute;System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" -nodefaultfilters  -hideskipped:All -filter:"+[*]* -[*.Tests]* -[Tests.*]* -[xunit.*]* -[*]Xunit.*" 
 
-if ($LastExitCode -ne 0) { 
-    Write-Host "Error with tests" -Foreground Red
-    if($isAppVeyor) {
-      $host.SetShouldExit($LastExitCode)
-    }  
-}
+
 
 # Either display or publish the results
 if ($env:CI -eq 'True')