Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions tools/TestNet472Modules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ if ($ModuleFilter)
$rmItems = $rmItems | Where {$_.FullName.Contains($ModuleFilter)}
}

$success = $true

$rmItems | %{`
Write-Host ("Testing " + $_.FullName)
$testDir = $_.Directory.FullName
Expand All @@ -32,14 +34,22 @@ $rmItems | %{`
$copiedItems = (Get-ChildItem $testExecDir | Where-Object {$_.Name.StartsWith("xunit")})
$copiedItems | Copy-Item -Destination $testDir
try {
Start-Process -FilePath $newExecPath `
-Wait `
-WorkingDirectory $testDir `
-NoNewWindow `
-ArgumentList $_.FullName, $testConfig, '-trait "AcceptanceType=CheckIn"', '-notrait "RunType=DesktopOnly"', '-notrait "RunType=CoreOnly"', "-xml $logPath" `
# xunit.console will not throw an exception when the tests failed. So we should handle the exitcode by adding option PassThru
$process = Start-Process -FilePath $newExecPath `
-Wait `
-WorkingDirectory $testDir `
-NoNewWindow `
-ArgumentList $_.FullName, $testConfig, '-trait "AcceptanceType=CheckIn"', '-notrait "RunType=DesktopOnly"', '-notrait "RunType=CoreOnly"', "-xml $logPath" -PassThru
if ($process.ExitCode -ne 0) {
$success = $false
}
}
finally {
$copiedItems | %{Remove-Item -Force (Join-Path $testDir $_.Name)}
}
}

if(-not $success) {
Write-Warning 'Failure: One or more test case failed.'
exit 1
}