瀏覽代碼

Improving build script to run more tests.

Bart De Smet 8 年之前
父節點
當前提交
15477f645c
共有 1 個文件被更改,包括 24 次插入1 次删除
  1. 24 1
      Ix.NET/Source/build-new.ps1

+ 24 - 1
Ix.NET/Source/build-new.ps1

@@ -137,12 +137,13 @@ if($hasSignClientSecret) {
 }
 
 Write-Host "Running tests" -Foreground Green
-$testDirectory = Join-Path $scriptPath "System.Interactive.Tests"  
 
 # OpenCover isn't working currently. So run tests on CI and coverage with JetBrains 
 
 # Use xUnit CLI as it's significantly faster than vstest (dotnet test)
 $dotnet = "$env:ProgramFiles\dotnet\dotnet.exe"
+
+$testDirectory = Join-Path $scriptPath "System.Interactive.Tests"  
 .\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Providers;+:module=System.Linq.Async;+:module=System.Linq.Async.Queryable;+:module=System.Interactive.Async;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover1"
 
 if ($LastExitCode -ne 0) { 
@@ -153,6 +154,17 @@ if ($LastExitCode -ne 0) {
     }
 }
 
+$testDirectory = Join-Path $scriptPath "System.Linq.Async.Tests"  
+.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Providers;+:module=System.Linq.Async;+:module=System.Linq.Async.Queryable;+:module=System.Interactive.Async;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover2"
+
+if ($LastExitCode -ne 0) { 
+    Write-Host "Error with tests" -Foreground Red
+    if($isAppVeyor) {
+      $host.SetShouldExit($LastExitCode)
+      exit $LastExitCode
+    }
+}
+
 $testDirectory = Join-Path $scriptPath "System.Interactive.Async.Tests"  
 .\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Providers;+:module=System.Linq.Async;+:module=System.Linq.Async.Queryable;+:module=System.Interactive.Async;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover2"
 
@@ -164,6 +176,17 @@ if ($LastExitCode -ne 0) {
     }
 }
 
+$testDirectory = Join-Path $scriptPath "System.Interactive.Async.Providers.Tests"  
+.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Providers;+:module=System.Linq.Async;+:module=System.Linq.Async.Queryable;+:module=System.Interactive.Async;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover2"
+
+if ($LastExitCode -ne 0) { 
+    Write-Host "Error with tests" -Foreground Red
+    if($isAppVeyor) {
+      $host.SetShouldExit($LastExitCode)
+      exit $LastExitCode
+    }
+}
+
 .\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe merge /Source="$outputFileDotCover1;$outputFileDotCover2" /Output="$outputFileDotCover"
 .\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe report /Source="$outputFileDotCover" /Output="$outputFile" /ReportType=DetailedXML /HideAutoProperties