提交 cd5e0a0f 编写于 作者: J Jared Parsons 提交者: GitHub

Merge pull request #20746 from jaredpar/fix-it

Fix an official issue
......@@ -12,17 +12,14 @@ param (
# Test options
[switch]$test32 = $false,
[switch]$test64 = $false,
[switch]$testVsi = $false,
[switch]$testVsiNetCore = $false,
[switch]$testDesktop = $false,
[switch]$testCoreClr = $false,
# Special test options
[switch]$testDeterminism = $false,
[switch]$testBuildCorrectness = $false,
[switch]$testPerfCorrectness = $false,
[switch]$testPerfRun = $false,
[switch]$testVsi = $false,
[switch]$testVsiNetCore = $false,
[switch]$testDesktop = $false,
[switch]$testCoreClr = $false,
[parameter(ValueFromRemainingArguments=$true)] $badArgs)
Set-StrictMode -version 2.0
......@@ -44,12 +41,8 @@ function Print-Usage() {
Write-Host " -testCoreClr Run CoreClr unit tests"
Write-Host " -testVsi Run all integration tests"
Write-Host " -testVsiNetCore Run just dotnet core integration tests"
Write-Host ""
Write-Host "Special Test options"
Write-Host " -testBuildCorrectness Run build correctness tests"
Write-Host " -testDeterminism Run determinism tests"
Write-Host " -testPerfCorrectness Run perf correctness tests"
Write-Host " -testPerfCorrectness Run perf tests"
}
# Process the command line arguments and establish defaults for the values which
......@@ -73,14 +66,12 @@ function Process-Arguments() {
exit 1
}
$script:isAnyTestSpecial = $testBuildCorrectness -or $testDeterminism -or $testPerfCorrectness -or $testPerfRun
if ($isAnyTestSpecial -and ($anyUnit -or $anyVsi)) {
Write-Host "Cannot combine special testing with any other action"
exit 1
}
$script:test32 = -not $test64
$script:debug = -not $release
if ($testDeterminism) {
$script:bootstrap = $true
}
}
function Run-MSBuild([string]$buildArgs = "", [string]$logFile = "") {
......@@ -131,44 +122,6 @@ function Make-BootstrapBuild() {
return $dir
}
function Build-Artifacts() {
Run-MSBuild "Roslyn.sln /p:Configuration=$buildConfiguration /p:DeployExtension=false"
if ($testDesktop) {
Run-MSBuild "src\Samples\Samples.sln /p:Configuration=$buildConfiguration /p:DeployExtension=false"
}
Stop-BuildProcesses
}
# These are tests that don't follow our standard restore, build, test pattern. They customize
# the processes in order to test specific elements of our build and hence are handled
# separately from our other tests
function Test-Special() {
if ($restore) {
Write-Host "Running restore"
Restore-All -msbuildDir $msbuildDir
}
if ($testBuildCorrectness) {
Exec-Block { & ".\build\scripts\test-build-correctness.ps1" -config $buildConfiguration } | Out-Host
}
elseif ($testDeterminism) {
$bootstrapDir = Make-BootstrapBuild
Exec-Block { & ".\build\scripts\test-determinism.ps1" -bootstrapDir $bootstrapDir } | Out-Host
}
elseif ($testPerfCorrectness) {
Test-PerfCorrectness
}
elseif ($testPerfRun) {
Test-PerfRun
}
else {
throw "Not a special test"
}
}
function Test-PerfCorrectness() {
Run-MSBuild "Roslyn.sln /p:Configuration=$buildConfiguration /p:DeployExtension=false"
Exec-Block { & ".\Binaries\$buildConfiguration\Exes\Perf.Runner\Roslyn.Test.Performance.Runner.exe" --ci-test } | Out-Host
......@@ -236,7 +189,25 @@ function Test-XUnit() {
return
}
if ($testVsi -or $testVsiNetCore) {
# To help the VS SDK team track down their issues around install via build temporarily
# re-enabling the build based deployment
#
# https://github.com/dotnet/roslyn/issues/17456
$deployExtensionViaBuild = $false
if ($build) {
$deployArg = if ($deployExtensionViaBuild) { "true" } else { "false" }
Run-MSBuild "Roslyn.sln /p:Configuration=$buildConfiguration /p:DeployExtension=$deployArg"
if ($testDesktop) {
Run-MSBuild "src\Samples\Samples.sln /p:Configuration=$buildConfiguration /p:DeployExtension=false"
}
Stop-BuildProcesses
}
$anyVsi = $testVsi -or $TestVsiNetCore
if ($anyVsi -and (-not $deployExtensionViaBuild)) {
Deploy-VsixViaTool
}
......@@ -426,28 +397,45 @@ try {
Redirect-Temp
}
if ($isAnyTestSpecial) {
Test-Special
exit 0
}
if ($restore) {
Write-Host "Running restore"
Restore-All -msbuildDir $msbuildDir
}
if ($testBuildCorrectness) {
Exec-Block { & ".\build\scripts\test-build-correctness.ps1" -config $buildConfiguration } | Out-Host
exit 0
}
if ($bootstrap) {
Write-Host "Making bootstrap"
$bootstrapDir = Make-BootstrapBuild
}
if ($build) {
Build-Artifacts
if ($testDeterminism) {
Exec-Block { & ".\build\scripts\test-determinism.ps1" -bootstrapDir $bootstrapDir } | Out-Host
exit 0
}
if ($testPerfCorrectness) {
Test-PerfCorrectness
exit 0
}
if ($testPerfRun) {
Test-PerfRun
exit 0
}
if ($testDesktop -or $testCoreClr -or $testVsi -or $testVsiNetCore) {
Test-XUnit
exit 0
}
if ($build) {
Run-MSBuild "Roslyn.sln /p:Configuration=$buildConfiguration /p:DeployExtension=false"
}
exit 0
}
catch {
......
......@@ -7,7 +7,7 @@
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<ScriptArgs></ScriptArgs>
<ScriptArgs Condition="'$(Configuration)' == 'Release'">-release</ScriptArgs>
<ScriptArgs Condition="'$(BUILD_SOURCEBRANCH)' != '">-branch $(BUILD_SOURCEBRANCH)</ScriptArgs>
<ScriptArgs Condition="'$(BUILD_SOURCEBRANCH)' != ''">-branch $(BUILD_SOURCEBRANCH)</ScriptArgs>
<ScriptArgs Condition="'$(RoslynNuGetApiKey)' != ''">-nugetApiKey $(RoslynNuGetApiKey)</ScriptArgs>
</PropertyGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册