Skip to content

Commit 13fc534

Browse files
committed
Run test tasks in foreground
1 parent 742acf9 commit 13fc534

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

make.ps1

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ function GenerateRunSettings([String] $framework, [String] $platform, [String] $
111111
return $fileName
112112
}
113113

114+
function RunTestTasksInForeground($tasks) {
115+
$failedTests = @()
116+
foreach ($task in $tasks) {
117+
& dotnet test $task.params
118+
Write-Host
119+
if($LastExitCode -ne 0) {
120+
$global:Result = $LastExitCode
121+
Write-Host -ForegroundColor Red "$($task.name) failed"
122+
$failedTests += $task.name
123+
} else {
124+
Write-Host "$($task.name) succeeded"
125+
}
126+
if ($failedTests) {
127+
Write-Host -ForegroundColor Red "$($failedTests.Count) test task(s) failed: $($failedTests -Join ", ")"
128+
}
129+
Write-Host
130+
}
131+
}
132+
114133
function RunTestTasks($tasks) {
115134
$maxJobs = $jobs
116135
if ($tasks.Count -lt $maxJobs) {
@@ -211,7 +230,11 @@ function Test([String] $target, [String] $configuration, [String[]] $frameworks,
211230
}
212231
}
213232

214-
RunTestTasks $tasks
233+
if ($jobs -eq 0) {
234+
RunTestTasksInForeground $tasks
235+
} else {
236+
RunTestTasks $tasks
237+
}
215238
}
216239

217240
function Purge() {

0 commit comments

Comments
 (0)