Skip to content

Commit

Permalink
Merge pull request #11089 from vslsnap/merge-master-into-future201605…
Browse files Browse the repository at this point in the history
…05-150019

Merge master into future
  • Loading branch information
msJohnHamby committed May 5, 2016
2 parents 0fa98bf + 8497f9f commit e9304b3
Show file tree
Hide file tree
Showing 82 changed files with 1,772 additions and 1,475 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
SHELL = /usr/bin/env bash
OS_NAME = $(shell uname -s)
NUGET_PACKAGE_NAME = nuget.future.70
BUILD_CONFIGURATION = Debug
BINARIES_PATH = $(shell pwd)/Binaries
TOOLSET_PATH = $(BINARIES_PATH)/toolset
RESTORE_SEMAPHORE_PATH = $(TOOLSET_PATH)/restore.semaphore
BOOTSTRAP_PATH = $(BINARIES_PATH)/Bootstrap
BUILD_LOG_PATH =
XUNIT_VERSION = 2.1.0
HOME_DIR = $(shell cd ~ && pwd)

MSBUILD_ADDITIONALARGS := /v:m /fl /fileloggerparameters:Verbosity=normal /p:Configuration=$(BUILD_CONFIGURATION)
Expand Down
20 changes: 8 additions & 12 deletions src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@
<None Include="PerfTests\CSharpPerfGoldilocksTyping.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="PerfTests\CSharpPerfGoldilocksTypingDiagnostics.xml">
<None Include="PerfTests\CSharpPerfGoldilocksTypingFullSolutionDiagnostics.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="PerfTests\CSharpPerfGoldilocksTypingDiagnosticsMultipliedDelay.xml">
<None Include="PerfTests\CSharpPerfGoldilocksTypingFullSolutionDiagnosticsMultipliedDelay.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="PerfTests\CSharpPerfNavigateTo.xml" />
Expand Down Expand Up @@ -482,28 +482,24 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<None Include="PerfTests\CSharpPerfGoldilocksTypingAnalyzers.xml">
<None Include="PerfTests\CSharpPerfGoldilocksTypingFullSolutionDiagnosticsThirdPartyAnalyzers.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None>
<None Include="PerfTests\CSharpPerfDiagnosticInsideMethodBody.xml">
<None Include="PerfTests\CSharpPerfFullSolutionDiagnostics.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="PerfTests\CSharpPerfDiagnosticTopLevel.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="PerfTests\CSharpPerfGoldilocksTypingAnalyzersWithErrorHub.xml">
<SubType>Designer</SubType>
<None Include="PerfTests\CSharpPerfLightBulb.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="PerfTests\CSharpPerfDiagnosticTopLevelWithErrorHub.xml">
<None Include="PerfTests\CSharpPerfFullSolutionDiagnosticsThirdPartyAnalyzers.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="PerfTests\CSharpPerfLightBulb.xml">
<None Include="PerfTests\CSharpPerfBuildWithThirdPartyAnalyzers.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None>
<Content Include="PerfTests\Sources\CSharpPgoTypingInput.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp.CodeFixes.AddImport;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Packaging;
using Microsoft.CodeAnalysis.Shared.Options;
using Microsoft.CodeAnalysis.SymbolSearch;
using Moq;
using Roslyn.Test.Utilities;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics.AddUsing
{
using FixProviderData = Tuple<IPackageInstallerService, IPackageSearchService>;
using FixProviderData = Tuple<IPackageInstallerService, ISymbolSearchService>;

public partial class AddUsingTests
{
Expand All @@ -27,6 +30,15 @@ public class NuGet : AddUsingTests
private static readonly ImmutableArray<PackageSource> NugetPackageSources =
ImmutableArray.Create(new PackageSource(NugetOrgSource, "http://nuget.org/"));

protected override async Task<TestWorkspace> CreateWorkspaceFromFileAsync(string definition, ParseOptions parseOptions, CompilationOptions compilationOptions)
{
var workspace = await base.CreateWorkspaceFromFileAsync(definition, parseOptions, compilationOptions);
workspace.Options = workspace.Options
.WithChangedOption(AddImportOptions.SuggestForTypesInNuGetPackages, LanguageNames.CSharp, true)
.WithChangedOption(AddImportOptions.SuggestForTypesInReferenceAssemblies, LanguageNames.CSharp, true);
return workspace;
}

internal override Tuple<DiagnosticAnalyzer, CodeFixProvider> CreateDiagnosticProviderAndFixer(
Workspace workspace, object fixProviderData)
{
Expand All @@ -50,7 +62,7 @@ public async Task TestSearchPackageSingleName()
installerServiceMock.SetupGet(i => i.IsEnabled).Returns(true);
installerServiceMock.SetupGet(i => i.PackageSources).Returns(NugetPackageSources);

var packageServiceMock = new Mock<IPackageSearchService>();
var packageServiceMock = new Mock<ISymbolSearchService>();
packageServiceMock.Setup(s => s.FindPackagesWithType(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NuGetNamespace")));
Expand Down Expand Up @@ -79,7 +91,7 @@ public async Task TestSearchPackageMultipleNames()
installerServiceMock.SetupGet(i => i.IsEnabled).Returns(true);
installerServiceMock.SetupGet(i => i.PackageSources).Returns(NugetPackageSources);

var packageServiceMock = new Mock<IPackageSearchService>();
var packageServiceMock = new Mock<ISymbolSearchService>();
packageServiceMock.Setup(s => s.FindPackagesWithType(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NS1", "NS2")));
Expand Down Expand Up @@ -110,7 +122,7 @@ public async Task TestMissingIfPackageAlreadyInstalled()
installerServiceMock.Setup(s => s.IsInstalled(It.IsAny<Workspace>(), It.IsAny<ProjectId>(), "NuGetPackage"))
.Returns(true);

var packageServiceMock = new Mock<IPackageSearchService>();
var packageServiceMock = new Mock<ISymbolSearchService>();
packageServiceMock.Setup(s => s.FindPackagesWithType(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NS1", "NS2")));
Expand All @@ -134,7 +146,7 @@ public async Task TestOptionsOffered()
installerServiceMock.Setup(s => s.GetInstalledVersions("NuGetPackage"))
.Returns(new[] { "1.0", "2.0" });

var packageServiceMock = new Mock<IPackageSearchService>();
var packageServiceMock = new Mock<ISymbolSearchService>();
packageServiceMock.Setup(s => s.FindPackagesWithType(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NS1", "NS2")));
Expand Down Expand Up @@ -180,7 +192,7 @@ public async Task TestInstallGetsCalledNoVersion()
installerServiceMock.Setup(s => s.TryInstallPackage(
It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", /*versionOpt*/ null, It.IsAny<CancellationToken>()));

var packageServiceMock = new Mock<IPackageSearchService>();
var packageServiceMock = new Mock<ISymbolSearchService>();
packageServiceMock.Setup(s => s.FindPackagesWithType(
NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NuGetNamespace")));
Expand Down Expand Up @@ -212,7 +224,7 @@ public async Task TestInstallGetsCalledWithVersion()
installerServiceMock.Setup(s => s.TryInstallPackage(
It.IsAny<Workspace>(), It.IsAny<DocumentId>(), It.IsAny<string>(), "NuGetPackage", "1.0", It.IsAny<CancellationToken>()));

var packageServiceMock = new Mock<IPackageSearchService>();
var packageServiceMock = new Mock<ISymbolSearchService>();
packageServiceMock.Setup(s => s.FindPackagesWithType(NugetOrgSource, "NuGetType", 0, It.IsAny<CancellationToken>()))
.Returns(CreateSearchResult("NuGetPackage", "NuGetType", CreateNameParts("NuGetNamespace")));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8" ?>

<TaoTest xmlns="http://microsoft.com/schemas/VSLanguages/TAO">
<InitTest>
<StartTarget DontResetOptions="true" />
<EnableClosedFileDiagnostic Enabled="true" Language="C#"/>
<PerfEnableEtwDiagnosticLogger/>
<OpenProject ProjectFile="C:\Roslyn\LegacyTest\RealworldProjects\RoslynSolutions\Roslyn-CSharp.sln" DeleteSuoFileBeforeOpening="true" DeleteIDECacheBeforeOpening="true" />
<!-- Disable built-in IDE analyzers -->
<DisableAnalyzers Analyzers = "Microsoft.CodeAnalysis.Features.dll;Microsoft.CodeAnalysis.CSharp.Features.dll;Microsoft.CodeAnalysis.VisualBasic.Features.dll;Microsoft.CodeAnalysis.EditorFeatures.dll;Microsoft.CodeAnalysis.CSharp.EditorFeatures.dll;Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.dll"
RulesetFile ="Tools\Targets\Roslyn.ruleset"/>
<!-- Add 3rd party C# StyleCop analyzers -->
<AddAnalyzersToSolution CSharpAnalyzers="References\Analyzers\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll;References\Analyzers\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll;References\Analyzers\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll"/>

<!-- Save all the project file modifications, so that we can trigger build with analyzers -->
<ExecuteCommand Command="File.SaveAll" />
</InitTest>

<ScenarioList>
<Scenario Name="Solution Build" Description="Build solution with analyzers">
<ForceGC />
<CleanSolution/>
<MeasureTimeStart ScenarioGroup="Solution Build" Step="Build" TimeGoal="0.1" MemoryGoal="0.9" />
<Build IgnoreBuildResult="true"/>
<MeasureTimeStop/>
</Scenario>

<Scenario Name="CompilationWithAnalyzers" Description="Get analyzer diagnostics with CompilationWithAnalyzers public API">
<ForceGC />
<MeasureTimeStart ScenarioGroup="CompilationWithAnalyzers" Step="CompilationWithAnalyzers" TimeGoal="0.1" MemoryGoal="0.9" />
<VerifyCompilationWithAnalyzers Count="220659"/>
<MeasureTimeStop/>
</Scenario>
</ScenarioList>

<CleanupTest>
<!-- Revert the ruleset changes -->
<ReplaceRuleset SourceRulesetFile="Tools\Targets\Roslyn_Default.ruleset" DestinationRulesetFile="Tools\Targets\Roslyn.ruleset"/>
<!-- Remove the added analyzers -->
<RemoveAnalyzersFromSolution CSharpAnalyzers="References\Analyzers\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll;References\Analyzers\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll;References\Analyzers\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll"/>
<!-- Save all the analyzer reference removals from the project files -->
<ExecuteCommand Command="File.SaveAll" />
<CloseTarget />
</CleanupTest>
</TaoTest>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>

<!-- This test measures typing responsiveness. It uses the same delay tracker as the DDRIT test. -->
<!-- This test measures background diagnostic analysis performance with: -->
<!-- (a) Full solution analysis turned **ON**. -->
<!-- (a) Built-in IDE analyzers. -->
<!-- It uses the same delay tracker as the DDRIT test. -->
<!-- This test doesn't produce a regular Tao perf results file. Instead it produce a log and a -->
<!-- results file. -->
<!-- This test uses a recording of three real users typing. -->
Expand All @@ -12,9 +15,6 @@
<PerfEnableEtwDiagnosticLogger/>
<OpenProject ProjectFile="C:\Roslyn\LegacyTest\RealworldProjects\RoslynSolutions\Roslyn-CSharp.sln" DeleteSuoFileBeforeOpening="true" DeleteIDECacheBeforeOpening="true"/>
<Wait Seconds="60" />
<AddAnalyzersToSolution CommonAnalyzers="Microsoft.CodeAnalysis.FxCopAnalyzers.dll"
CSharpAnalyzers="Microsoft.CodeAnalysis.CSharp.FxCopAnalyzers.dll"
VisualBasicAnalyzers="Microsoft.CodeAnalysis.VisualBasic.FxCopAnalyzers.dll"/>
<ForceGC/>
</InitTest>

Expand Down
Loading

0 comments on commit e9304b3

Please sign in to comment.