代码拉取完成,页面将自动刷新
[CmdletBinding(DefaultParameterSetName='RegularBuild')]
param (
[ValidateSet("debug", "release")]
[string]$Configuration = 'debug',
[int]$BuildNumber
)
# For TeamCity - If any issue occurs, this script fail the build. - By default, TeamCity returns an exit code of 0 for all powershell scripts, even if they fail
trap {
Write-Host "BUILD FAILED: $_" -ForegroundColor Red
Write-Host "ERROR DETAILS:" -ForegroundColor Red
Write-Host $_.Exception -ForegroundColor Red
Write-Host ("`r`n" * 3)
exit 1
}
. "$PSScriptRoot\build\common.ps1"
Function Run-Tests {
[CmdletBinding()]
param()
Trace-Log 'Running tests'
$xUnitExe = (Join-Path $PSScriptRoot "packages\xunit.runner.console.2.1.0\tools\xunit.console.exe")
$TestAssemblies = "test\NuGet.Server.Core.Tests\bin\$Configuration\NuGet.Server.Core.Tests.dll", `
"test\NuGet.Server.V2.Tests\bin\$Configuration\NuGet.Server.V2.Tests.dll", `
"test\NuGet.Server.Tests\bin\$Configuration\NuGet.Server.Tests.dll"
$TestCount = 0
foreach ($Test in $TestAssemblies) {
& $xUnitExe (Join-Path $PSScriptRoot $Test) -xml "Results.$TestCount.xml"
$TestCount++
}
}
Write-Host ("`r`n" * 3)
Trace-Log ('=' * 60)
$startTime = [DateTime]::UtcNow
if (-not $BuildNumber) {
$BuildNumber = Get-BuildNumber
}
Trace-Log "Build #$BuildNumber started at $startTime"
$BuildErrors = @()
Invoke-BuildStep 'Running tests' { Run-Tests } `
-ev +BuildErrors
Trace-Log ('-' * 60)
## Calculating Build time
$endTime = [DateTime]::UtcNow
Trace-Log "Build #$BuildNumber ended at $endTime"
Trace-Log "Time elapsed $(Format-ElapsedTime ($endTime - $startTime))"
Trace-Log ('=' * 60)
if ($BuildErrors) {
$ErrorLines = $BuildErrors | %{ ">>> $($_.Exception.Message)" }
Error-Log "Tests completed with $($BuildErrors.Count) error(s):`r`n$($ErrorLines -join "`r`n")" -Fatal
}
Write-Host ("`r`n" * 3)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。