Merge remote-tracking branch 'dotnet/main' into fix_long_cmdlines
This commit is contained in:
Коммит
0cf4974704
|
@ -11,12 +11,14 @@ pr:
|
|||
variables:
|
||||
- name: DOTNET_ROOT
|
||||
value: $(Build.SourcesDirectory)\.dotnet
|
||||
- name: XUNIT_LOGS
|
||||
value: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)
|
||||
|
||||
jobs:
|
||||
- job: Windows
|
||||
pool:
|
||||
name: NetCore1ESPool-Svc-Public
|
||||
demands: ImageOverride -equals Build.Windows.10.Amd64.Open
|
||||
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open
|
||||
strategy:
|
||||
maxParallel: 6
|
||||
matrix:
|
||||
|
@ -29,11 +31,11 @@ jobs:
|
|||
_configuration: Release
|
||||
_solution: Samples
|
||||
SDK Debug Test:
|
||||
_args: -test
|
||||
_args: -test -integrationTest
|
||||
_configuration: Debug
|
||||
_solution: Roslyn-SDK
|
||||
SDK Release Test:
|
||||
_args: -test
|
||||
_args: -test -integrationTest
|
||||
_configuration: Release
|
||||
_solution: Roslyn-SDK
|
||||
SDK Pack:
|
||||
|
@ -54,7 +56,7 @@ jobs:
|
|||
ArtifactName: '$(_solution) $(_configuration) logs'
|
||||
publishLocation: Container
|
||||
continueOnError: true
|
||||
condition: failed()
|
||||
condition: not(succeeded())
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testRunner: 'xUnit'
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
<PropertyGroup>
|
||||
<!-- Versions used by several individual references below -->
|
||||
<MicrosoftCodeAnalysisPackagesVersion>4.0.0-1.21267.34</MicrosoftCodeAnalysisPackagesVersion>
|
||||
<MicrosoftVisualStudioShellPackagesVersion>17.0.0-previews-1-31318-291</MicrosoftVisualStudioShellPackagesVersion>
|
||||
<MicrosoftVisualStudioEditorPackagesVersion>17.0.65-g6c25c21ba5</MicrosoftVisualStudioEditorPackagesVersion>
|
||||
<MicrosoftVisualStudioShellPackagesVersion>17.0.0-previews-4-31709-430</MicrosoftVisualStudioShellPackagesVersion>
|
||||
<MicrosoftVisualStudioEditorPackagesVersion>17.0.391-preview-g5e248c9073</MicrosoftVisualStudioEditorPackagesVersion>
|
||||
<!-- Roslyn -->
|
||||
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.2</MicrosoftCodeAnalysisAnalyzersVersion>
|
||||
<MicrosoftCodeAnalysisCommonVersion>$(MicrosoftCodeAnalysisPackagesVersion)</MicrosoftCodeAnalysisCommonVersion>
|
||||
|
@ -33,7 +33,7 @@
|
|||
<!-- VS SDK -->
|
||||
<EnvDTE80Version>$(MicrosoftVisualStudioShellPackagesVersion)</EnvDTE80Version>
|
||||
<EnvDTEVersion>$(MicrosoftVisualStudioShellPackagesVersion)</EnvDTEVersion>
|
||||
<MicrosoftServiceHubFrameworkVersion>2.8.2018</MicrosoftServiceHubFrameworkVersion>
|
||||
<MicrosoftServiceHubFrameworkVersion>3.0.2065</MicrosoftServiceHubFrameworkVersion>
|
||||
<MicrosoftVisualStudioCompositionVersion>16.9.6-alpha</MicrosoftVisualStudioCompositionVersion>
|
||||
<MicrosoftVisualStudioComponentModelHostVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioComponentModelHostVersion>
|
||||
<MicrosoftVisualStudioCoreUtilityVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioCoreUtilityVersion>
|
||||
|
@ -43,7 +43,7 @@
|
|||
<MicrosoftVisualStudioImagingVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioImagingVersion>
|
||||
<MicrosoftVisualStudioInteropVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioInteropVersion>
|
||||
<MicrosoftVisualStudioLanguageStandardClassificationVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioLanguageStandardClassificationVersion>
|
||||
<MicrosoftVisualStudioSDKAnalyzersVersion>16.9.2-alpha</MicrosoftVisualStudioSDKAnalyzersVersion>
|
||||
<MicrosoftVisualStudioSDKAnalyzersVersion>16.10.10</MicrosoftVisualStudioSDKAnalyzersVersion>
|
||||
<MicrosoftVisualStudioShell150Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShell150Version>
|
||||
<MicrosoftVisualStudioShellFrameworkVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellFrameworkVersion>
|
||||
<MicrosoftVisualStudioShellInteropVersion>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioShellInteropVersion>
|
||||
|
@ -51,14 +51,14 @@
|
|||
<MicrosoftVisualStudioTextLogicVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextLogicVersion>
|
||||
<MicrosoftVisualStudioTextManagerInterop80Version>$(MicrosoftVisualStudioShellPackagesVersion)</MicrosoftVisualStudioTextManagerInterop80Version>
|
||||
<MicrosoftVisualStudioTextUIWpfVersion>$(MicrosoftVisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextUIWpfVersion>
|
||||
<MicrosoftVisualStudioThreadingVersion>17.0.15-alpha</MicrosoftVisualStudioThreadingVersion>
|
||||
<MicrosoftVisualStudioThreadingVersion>17.0.46-alpha</MicrosoftVisualStudioThreadingVersion>
|
||||
<MicrosoftVisualStudioUtilitiesInternalVersion>16.3.23</MicrosoftVisualStudioUtilitiesInternalVersion>
|
||||
<MicrosoftVisualStudioValidationVersion>17.0.11-alpha</MicrosoftVisualStudioValidationVersion>
|
||||
<NuGetSolutionRestoreManagerInteropVersion>5.6.0</NuGetSolutionRestoreManagerInteropVersion>
|
||||
<StreamJsonRpcVersion>2.7.67</StreamJsonRpcVersion>
|
||||
<StreamJsonRpcVersion>2.7.70</StreamJsonRpcVersion>
|
||||
<VSLangProjVersion>$(MicrosoftVisualStudioShellPackagesVersion)</VSLangProjVersion>
|
||||
<MicrosoftVisualStudioTemplateWizardInterfaceVersion>17.0.0-preview-1-30928-1111</MicrosoftVisualStudioTemplateWizardInterfaceVersion>
|
||||
<MicrosoftVSSDKBuildToolsVersion>17.0.1056-Dev17PIAs-g9dffd635</MicrosoftVSSDKBuildToolsVersion>
|
||||
<MicrosoftVSSDKBuildToolsVersion>17.0.4207-preview4</MicrosoftVSSDKBuildToolsVersion>
|
||||
<MicroBuildPluginsSwixBuildVersion>1.1.33</MicroBuildPluginsSwixBuildVersion>
|
||||
<SystemThreadingTasksDataflowVersion>5.0.0</SystemThreadingTasksDataflowVersion>
|
||||
<!-- Project System-->
|
||||
|
@ -74,7 +74,7 @@
|
|||
<MicrosoftCodeAnalysisTestingVersion>1.0.1-beta1.20374.2</MicrosoftCodeAnalysisTestingVersion>
|
||||
<xunitassertVersion>$(xunitVersion)</xunitassertVersion>
|
||||
<XunitCombinatorialVersion>1.2.7</XunitCombinatorialVersion>
|
||||
<VsixTestingXunitVersion>0.1.49-beta</VsixTestingXunitVersion>
|
||||
<MicrosoftVisualStudioExtensibilityTestingXunitVersion>0.1.73-beta</MicrosoftVisualStudioExtensibilityTestingXunitVersion>
|
||||
<!-- Analyzers -->
|
||||
<RoslynDiagnosticsAnalyzersVersion>2.9.8</RoslynDiagnosticsAnalyzersVersion>
|
||||
<StyleCopAnalyzersVersion>1.2.0-beta.164</StyleCopAnalyzersVersion>
|
||||
|
|
|
@ -106,6 +106,8 @@ function Build {
|
|||
$properties = $msbuildArgs
|
||||
}
|
||||
|
||||
dotnet --list-sdks
|
||||
|
||||
MSBuild $toolsetBuildProj `
|
||||
$bl `
|
||||
$platformArg `
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.1.192" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.8.3038" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.1.192" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.8.3038" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.1.192" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.8.3038" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.1.192" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.8.3038" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<GeneratePkgDefFile>true</GeneratePkgDefFile>
|
||||
<EnableDefaultItems>false</EnableDefaultItems>
|
||||
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
|
||||
<DeployProjectOutput>false</DeployProjectOutput>
|
||||
<!-- VS Insertion -->
|
||||
<VisualStudioInsertionComponent>Microsoft.CodeAnalysis.SDK</VisualStudioInsertionComponent>
|
||||
<SetupProductArch>Neutral</SetupProductArch>
|
||||
|
|
|
@ -2,18 +2,19 @@
|
|||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Id="ef918f69-be54-4b44-b381-81d6cecef939" Version="|%CurrentProject%;GetVsixVersion|" Language="en-US" Publisher="Microsoft" />
|
||||
<DisplayName>.NET Compiler Platform SDK For Visual Studio 2017</DisplayName>
|
||||
<DisplayName>.NET Compiler Platform SDK For Visual Studio 2022</DisplayName>
|
||||
<Description xml:space="preserve">The .NET Compiler Platform ("Roslyn") provides open-source C# and Visual Basic compilers with rich code analysis APIs. You can build code analysis tools with the same APIs that Microsoft is using to implement Visual Studio! Also includes the Syntax Visualizer, a Visual Studio extension that allows you to inspect and explore the syntax trees you'll use as you build applications and VS extensions atop the .NET Compiler Platform ("Roslyn").</Description>
|
||||
<PackageId>Roslyn.SDK</PackageId>
|
||||
<License>EULA.rtf</License>
|
||||
<Tags>roslyn,template,SDK</Tags>
|
||||
</Metadata>
|
||||
<Installation Experimental="true">
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[15.0.27009,)" />
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
|
||||
<ProductArchitecture>amd64</ProductArchitecture>
|
||||
</InstallationTarget>
|
||||
</Installation>
|
||||
<Dependencies>
|
||||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
|
||||
<Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0]" />
|
||||
</Dependencies>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" Path="CSharpConsoleApplication"/>
|
||||
|
@ -33,9 +34,6 @@
|
|||
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="Roslyn.ComponentDebugger" Path="|Roslyn.ComponentDebugger|" />
|
||||
</Assets>
|
||||
<Prerequisites>
|
||||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
|
||||
<Prerequisite Id="Microsoft.VisualStudio.Component.VSSDK" Version="[15.0,16.0)" DisplayName="Visual Studio SDK" />
|
||||
<Prerequisite Id="Microsoft.Net.ComponentGroup.DevelopmentPrerequisites" Version="[15.0,16.0)" DisplayName=".NET Framework 4.6.1 development tools" />
|
||||
<Prerequisite Id="Microsoft.Net.Core.Component.SDK" Version="[15.0,16.0)" DisplayName=".NET Core 2.0 development tools" />
|
||||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
|
||||
</Prerequisites>
|
||||
</PackageManifest>
|
||||
|
|
|
@ -55,12 +55,8 @@
|
|||
|
||||
<ItemGroup>
|
||||
<None Include="xlf\*" />
|
||||
<Resource Include="SyntaxTree.bmp">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="SyntaxTree.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="SyntaxTree.bmp" />
|
||||
<Resource Include="SyntaxTree.ico" />
|
||||
<EmbeddedResource Include="Resources.resx" GenerateSource="true" />
|
||||
<EmbeddedResource Include="VSPackage.resx">
|
||||
<MergeWithCTO>true</MergeWithCTO>
|
||||
|
|
|
@ -10,16 +10,15 @@
|
|||
<Tags>roslyn,syntax,visualizer</Tags>
|
||||
</Metadata>
|
||||
<Installation InstalledByMsi="false">
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[14.0,)" />
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,)" />
|
||||
</Installation>
|
||||
<Dependencies>
|
||||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
|
||||
<Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0]" />
|
||||
</Dependencies>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
|
||||
</Assets>
|
||||
<Prerequisites>
|
||||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
|
||||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
|
||||
</Prerequisites>
|
||||
</PackageManifest>
|
||||
|
|
|
@ -16,13 +16,14 @@ using Task = System.Threading.Tasks.Task;
|
|||
|
||||
namespace Microsoft.CodeAnalysis.Testing
|
||||
{
|
||||
[VsTestSettings(UIThread = true, Version = "2019")]
|
||||
public abstract class AbstractIdeIntegrationTest : IAsyncLifetime, IDisposable
|
||||
{
|
||||
protected const VisualStudioVersion TestVersion = VisualStudioVersion.VS2022;
|
||||
|
||||
/// <summary>
|
||||
/// A long timeout used to avoid hangs in tests, where a test failure manifests as an operation never occurring.
|
||||
/// </summary>
|
||||
public static readonly TimeSpan HangMitigatingTimeout = TimeSpan.FromMinutes(1);
|
||||
public static readonly TimeSpan HangMitigatingTimeout = TimeSpan.FromMinutes(4);
|
||||
|
||||
private JoinableTaskContext? _joinableTaskContext;
|
||||
private JoinableTaskCollection? _joinableTaskCollection;
|
||||
|
|
|
@ -22,11 +22,11 @@ namespace Microsoft.CodeAnalysis.Testing
|
|||
await base.DisposeAsync();
|
||||
}
|
||||
|
||||
[VsFact]
|
||||
[IdeFact(MinVersion = TestVersion, MaxVersion = TestVersion)]
|
||||
public async Task CreateFromTemplateAsync()
|
||||
{
|
||||
await TestServices.SolutionExplorer.CreateSolutionAsync(nameof(CreateProjectTests));
|
||||
await TestServices.SolutionExplorer.AddProjectAsync("TestProj", WellKnownProjectTemplates.ClassLibrary, languageName: LanguageNames.CSharp);
|
||||
await TestServices.SolutionExplorer.AddProjectAsync("TestProj", WellKnownProjectTemplates.CSharpNetCoreClassLibrary, languageName: LanguageNames.CSharp);
|
||||
await TestServices.SolutionExplorer.RestoreNuGetPackagesAsync(HangMitigatingCancellationToken);
|
||||
|
||||
await TestServices.Editor.SetTextAsync(@"using System");
|
||||
|
@ -43,7 +43,7 @@ namespace Microsoft.CodeAnalysis.Testing
|
|||
Assert.Equal(1, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_ERROR));
|
||||
}
|
||||
|
||||
[VsFact]
|
||||
[IdeFact(MinVersion = TestVersion, MaxVersion = TestVersion)]
|
||||
public async Task CreateAnalyzerFromCSharpTemplateAsync()
|
||||
{
|
||||
await TestServices.SolutionExplorer.CreateSolutionAsync(nameof(CreateProjectTests));
|
||||
|
@ -61,13 +61,11 @@ namespace Microsoft.CodeAnalysis.Testing
|
|||
|
||||
// Currently have two analyzer warnings in the template.
|
||||
var warnings = await TestServices.ErrorList.GetBuildErrorsAsync(__VSERRORCATEGORY.EC_WARNING);
|
||||
var expected = @"(Compiler) TestProjAnalyzer.cs(29, 57): warning RS1025: Configure generated code analysis
|
||||
(Compiler) TestProjAnalyzer.cs(29, 57): warning RS1026: Enable concurrent execution";
|
||||
new XUnitVerifier().EqualOrDiff(expected, string.Join(Environment.NewLine, warnings));
|
||||
Assert.Equal(2, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_WARNING));
|
||||
new XUnitVerifier().EqualOrDiff(string.Empty, string.Join(Environment.NewLine, warnings));
|
||||
Assert.Equal(0, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_WARNING));
|
||||
}
|
||||
|
||||
[VsFact]
|
||||
[IdeFact(MinVersion = TestVersion, MaxVersion = TestVersion)]
|
||||
public async Task CreateRefactoringFromCSharpTemplateAsync()
|
||||
{
|
||||
await TestServices.SolutionExplorer.CreateSolutionAsync(nameof(CreateProjectTests));
|
||||
|
@ -83,7 +81,7 @@ namespace Microsoft.CodeAnalysis.Testing
|
|||
Assert.Equal(0, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_WARNING));
|
||||
}
|
||||
|
||||
[VsFact]
|
||||
[IdeFact(MinVersion = TestVersion, MaxVersion = TestVersion)]
|
||||
public async Task CreateStandaloneToolFromCSharpTemplateAsync()
|
||||
{
|
||||
await TestServices.SolutionExplorer.CreateSolutionAsync(nameof(CreateProjectTests));
|
||||
|
@ -99,7 +97,7 @@ namespace Microsoft.CodeAnalysis.Testing
|
|||
Assert.Equal(0, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_WARNING));
|
||||
}
|
||||
|
||||
[VsFact]
|
||||
[IdeFact(MinVersion = TestVersion, MaxVersion = TestVersion)]
|
||||
public async Task CreateAnalyzerFromVisualBasicTemplateAsync()
|
||||
{
|
||||
await TestServices.SolutionExplorer.CreateSolutionAsync(nameof(CreateProjectTests));
|
||||
|
@ -117,13 +115,11 @@ namespace Microsoft.CodeAnalysis.Testing
|
|||
|
||||
// Currently have two analyzer warnings in the template.
|
||||
var warnings = await TestServices.ErrorList.GetBuildErrorsAsync(__VSERRORCATEGORY.EC_WARNING);
|
||||
var expected = @"(Compiler) TestProjAnalyzer.vb(32, 37): warning RS1025: Configure generated code analysis
|
||||
(Compiler) TestProjAnalyzer.vb(32, 37): warning RS1026: Enable concurrent execution";
|
||||
new XUnitVerifier().EqualOrDiff(expected, string.Join(Environment.NewLine, warnings));
|
||||
Assert.Equal(2, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_WARNING));
|
||||
new XUnitVerifier().EqualOrDiff(string.Empty, string.Join(Environment.NewLine, warnings));
|
||||
Assert.Equal(0, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_WARNING));
|
||||
}
|
||||
|
||||
[VsFact]
|
||||
[IdeFact(MinVersion = TestVersion, MaxVersion = TestVersion)]
|
||||
public async Task CreateRefactoringFromVisualBasicTemplateAsync()
|
||||
{
|
||||
await TestServices.SolutionExplorer.CreateSolutionAsync(nameof(CreateProjectTests));
|
||||
|
@ -139,7 +135,7 @@ namespace Microsoft.CodeAnalysis.Testing
|
|||
Assert.Equal(0, await TestServices.ErrorList.GetErrorCountAsync(__VSERRORCATEGORY.EC_WARNING));
|
||||
}
|
||||
|
||||
[VsFact]
|
||||
[IdeFact(MinVersion = TestVersion, MaxVersion = TestVersion)]
|
||||
public async Task CreateStandaloneToolFromVisualBasicTemplateAsync()
|
||||
{
|
||||
await TestServices.SolutionExplorer.CreateSolutionAsync(nameof(CreateProjectTests));
|
||||
|
|
|
@ -135,12 +135,12 @@ namespace Microsoft.CodeAnalysis.Testing.InProcess
|
|||
{
|
||||
await JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
|
||||
var dte = await GetRequiredGlobalServiceAsync<SDTE, EnvDTE.DTE>();
|
||||
var solution = (EnvDTE80.Solution2)dte.Solution;
|
||||
var solutionFullName = solution.FullName;
|
||||
var solutionFileFullPath = string.IsNullOrEmpty(solutionFullName)
|
||||
? throw new InvalidOperationException()
|
||||
: solutionFullName;
|
||||
var solution = await GetRequiredGlobalServiceAsync<SVsSolution, IVsSolution>();
|
||||
ErrorHandler.ThrowOnFailure(solution.GetSolutionInfo(out _, out var solutionFileFullPath, out _));
|
||||
if (string.IsNullOrEmpty(solutionFileFullPath))
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
return Path.GetDirectoryName(solutionFileFullPath);
|
||||
}
|
||||
|
@ -149,8 +149,8 @@ namespace Microsoft.CodeAnalysis.Testing.InProcess
|
|||
{
|
||||
await JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
|
||||
var dte = await GetRequiredGlobalServiceAsync<SDTE, EnvDTE.DTE>();
|
||||
var localeID = dte.LocaleID;
|
||||
var hostLocale = await GetRequiredGlobalServiceAsync<SUIHostLocale, IUIHostLocale>();
|
||||
ErrorHandler.ThrowOnFailure(hostLocale.GetUILocale(out var localeID));
|
||||
|
||||
var builder = ImmutableDictionary.CreateBuilder<string, string>();
|
||||
builder[WellKnownProjectTemplates.ClassLibrary] = $@"Windows\{localeID}\ClassLibrary.zip";
|
||||
|
@ -166,8 +166,8 @@ namespace Microsoft.CodeAnalysis.Testing.InProcess
|
|||
{
|
||||
await JoinableTaskFactory.SwitchToMainThreadAsync();
|
||||
|
||||
var dte = await GetRequiredGlobalServiceAsync<SDTE, EnvDTE.DTE>();
|
||||
var localeID = dte.LocaleID;
|
||||
var hostLocale = await GetRequiredGlobalServiceAsync<SUIHostLocale, IUIHostLocale>();
|
||||
ErrorHandler.ThrowOnFailure(hostLocale.GetUILocale(out var localeID));
|
||||
|
||||
var builder = ImmutableDictionary.CreateBuilder<string, string>();
|
||||
builder[WellKnownProjectTemplates.ClassLibrary] = $@"Windows\{localeID}\ClassLibrary.zip";
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
<RootNamespace>Microsoft.CodeAnalysis.Testing</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\src\Microsoft.CodeAnalysis.Testing\Microsoft.CodeAnalysis.Analyzer.Testing\ExceptionUtilities.cs" Link="ExceptionUtilities.cs" />
|
||||
<Compile Include="..\..\..\src\Microsoft.CodeAnalysis.Testing\Microsoft.CodeAnalysis.Analyzer.Testing\Extensions\IVerifierExtensions.cs" Link="IVerifierExtensions.cs" />
|
||||
|
@ -19,35 +20,54 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DiffPlex" Version="$(DiffPlexVersion)" />
|
||||
<PackageReference Include="EnvDTE80" Version="$(EnvDTE80Version)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="$(MicrosoftVisualStudioImagingInterop140DesignTimeVersion)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="$(MicrosoftVisualStudioShell150Version)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Shell.Framework" Version="$(MicrosoftVisualStudioShellFrameworkVersion)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="$(MicrosoftVisualStudioShellInteropVersion)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop.8.0" Version="$(MicrosoftVisualStudioTextManagerInterop80Version)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="$(MicrosoftVisualStudioThreadingVersion)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Utilities.Internal" Version="$(MicrosoftVisualStudioUtilitiesInternalVersion)" />
|
||||
<PackageReference Include="NuGet.SolutionRestoreManager.Interop" Version="$(NuGetSolutionRestoreManagerInteropVersion)" />
|
||||
<PackageReference Include="StreamJsonRpc" Version="$(StreamJsonRpcVersion)" />
|
||||
<PackageReference Include="VsixTesting.Xunit" Version="$(VsixTestingXunitVersion)" />
|
||||
<!-- Explicit reference to avoid missing package warning -->
|
||||
<PackageReference Include="Microsoft.VisualStudio.Extensibility.Testing.Xunit" Version="$(MicrosoftVisualStudioExtensibilityTestingXunitVersion)" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Interop" Version="$(MicrosoftVisualStudioInteropVersion)" />
|
||||
<PackageReference Include="VSLangProj" Version="$(VSLangProjVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\VisualStudio.Roslyn.SDK\Roslyn.SDK\Roslyn.SDK.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\VisualStudio.Roslyn.SDK\Roslyn.SDK\Roslyn.SDK.csproj" CopyVsix="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PrepareVsixProjectReferences" BeforeTargets="ResolveProjectReferences" DependsOnTargets="PrepareProjectReferences">
|
||||
<MSBuild Projects="@(_MSBuildProjectReferenceExistent)" Targets="CreateVsixContainer;VSIXContainerProjectOutputGroup" BuildInParallel="$(BuildInParallel)" Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework); CreateVsixContainer=true" Condition="'%(_MSBuildProjectReferenceExistent.CopyVsix)' == 'true'" ContinueOnError="!$(BuildingProject)" RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="Xunit.Harness.RequireExtensionAttribute">
|
||||
<_Parameter1>Roslyn.SDK.vsix</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="SetEnvironmentVariablesForXUnit" BeforeTargets="RunTests">
|
||||
<PropertyGroup>
|
||||
<_OriginalNuGetPackageRoot>$(NuGetPackageRoot)</_OriginalNuGetPackageRoot>
|
||||
|
||||
<!-- Use the first variable in the definition of $(_XUnitConsoleExePath) to change environment variables as part of launching tests -->
|
||||
<NuGetPackageRoot>cmd" /c & (set DOTNET_MULTILEVEL_LOOKUP=) & (set DOTNET_INSTALL_DIR=) & (set DOTNET_ROOT=) & "$(NuGetPackageRoot)</NuGetPackageRoot>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreBuildState" AfterTargets="RunTests">
|
||||
<PropertyGroup>
|
||||
<NuGetPackageRoot>$(_OriginalNuGetPackageRoot)</NuGetPackageRoot>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="PrepareVsixProjectReferences"
|
||||
BeforeTargets="ResolveProjectReferences"
|
||||
DependsOnTargets="PrepareProjectReferences">
|
||||
<MSBuild
|
||||
Projects="@(_MSBuildProjectReferenceExistent)"
|
||||
Targets="VSIXContainerProjectOutputGroup"
|
||||
BuildInParallel="$(BuildInParallel)"
|
||||
Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework); CreateVsixContainer=true"
|
||||
Condition="'%(_MSBuildProjectReferenceExistent.CopyVsix)' == 'true'"
|
||||
ContinueOnError="!$(BuildingProject)"
|
||||
RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
|
||||
|
||||
<Output TaskParameter="TargetOutputs" ItemName="_ProjectReferenceVsixOutputs" />
|
||||
</MSBuild>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="@(_ProjectReferenceVsixOutputs)" Condition="Exists('%(Identity)')" CopyToOutputDirectory="PreserveNewest" />
|
||||
<ReferenceCopyLocalPaths Include="@(_ProjectReferenceVsixOutputs)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче