提交 130a05c0 编写于 作者: T Tanner Gooding

Fixing the casing from VSI to Vsi, making protected members pascal cased, and...

Fixing the casing from VSI to Vsi, making protected members pascal cased, and ensuring that the required package Ids are correct.
上级 eb62d044
......@@ -13,11 +13,11 @@
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<RunTestArgs Condition="'$(ManualTest)' == ''">$(RunTestArgs) -xml</RunTestArgs>
<RunTestArgs Condition="'$(Test64)' == 'true'">$(RunTestArgs) -test64</RunTestArgs>
<RunTestArgs Condition="'$(TestVSI)' == 'true'">$(RunTestArgs) -testVSI</RunTestArgs>
<RunTestArgs Condition="'$(TestVsi)' == 'true'">$(RunTestArgs) -testVsi</RunTestArgs>
<RunTestArgs Condition="'$(Trait)' != ''">$(RunTestArgs) -trait:$(Trait)</RunTestArgs>
<RunTestArgs Condition="'$(NoTrait)' != ''">$(RunTestArgs) -notrait:$(NoTrait)</RunTestArgs>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVSI)' != 'true'">*.UnitTests*.dll</IncludePattern>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVSI)' == 'true'">*.IntegrationTests*.dll</IncludePattern>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' != 'true'">*.UnitTests*.dll</IncludePattern>
<IncludePattern Condition="'$(IncludePattern)' == '' AND '$(TestVsi)' == 'true'">*.IntegrationTests*.dll</IncludePattern>
<OutputDirectory>Binaries\$(Configuration)</OutputDirectory>
<NuGetPackageRoot>$(UserProfile)\.nuget\packages</NuGetPackageRoot>
<CoreClrTestDirectory>$(OutputDirectory)\CoreClrTest</CoreClrTestDirectory>
......@@ -25,11 +25,11 @@
RestorePackages=false;
TreatWarningsAsErrors=true;
</MSBuildCommonProperties>
<MSBuildCommonProperties Condition="'$(TestVSI)' != 'true'">
<MSBuildCommonProperties Condition="'$(TestVsi)' != 'true'">
$(MSBuildCommonProperties);
DeployExtension=false;
</MSBuildCommonProperties>
<MSBuildCommonProperties Condition="'$(TestVSI)' == 'true'">
<MSBuildCommonProperties Condition="'$(TestVsi)' == 'true'">
$(MSBuildCommonProperties);
DeployExtension=true;
</MSBuildCommonProperties>
......@@ -111,7 +111,7 @@
<RunTestsArgs>$(NuGetPackageRoot)\xunit.runner.console\$(xunitrunnerconsoleVersion)\tools $(RunTestArgs) @(TestAssemblies, ' ')</RunTestsArgs>
</PropertyGroup>
<Exec Condition="'$(RunProcessWatchdog)' != 'true' AND '$(TestVSI)' != 'true'" Command="&quot;$(CoreRunExe)&quot; $(CoreRunArgs)" />
<Exec Condition="'$(RunProcessWatchdog)' != 'true' AND '$(TestVsi)' != 'true'" Command="&quot;$(CoreRunExe)&quot; $(CoreRunArgs)" />
<Exec Condition="'$(RunProcessWatchdog)' != 'true'" Command="&quot;$(RunTestsExe)&quot; $(RunTestsArgs)" />
......
......@@ -20,7 +20,7 @@ if /I "%1" == "/test64" set Test64=true&&shift&& goto :ParseArguments
if /I "%1" == "/testDeterminism" set TestDeterminism=true&&shift&& goto :ParseArguments
if /I "%1" == "/testPerfCorrectness" set TestPerfCorrectness=true&&shift&& goto :ParseArguments
if /I "%1" == "/testPerfRun" set TestPerfRun=true&&shift&& goto :ParseArguments
if /I "%1" == "/testVSI" set TestVSI=true&&shift&& goto :ParseArguments
if /I "%1" == "/testVsi" set TestVsi=true&&shift&& goto :ParseArguments
REM /buildTimeLimit is the time limit, measured in minutes, for the Jenkins job that runs
REM the build. The Jenkins script netci.groovy passes the time limit to this script.
......@@ -91,7 +91,7 @@ if defined TestPerfRun (
exit /b 0
)
msbuild %MSBuildAdditionalCommandLineArgs% /p:BootstrapBuildPath="%bindir%\Bootstrap" BuildAndTest.proj /p:Configuration=%BuildConfiguration% /p:Test64=%Test64% /p:TestVSI=%TestVSI% /p:RunProcessWatchdog=%RunProcessWatchdog% /p:BuildStartTime=%BuildStartTime% /p:"ProcDumpExe=%ProcDumpExe%" /p:BuildTimeLimit=%BuildTimeLimit% /p:PathMap="%RoslynRoot%=q:\roslyn" /p:Feature=pdb-path-determinism /fileloggerparameters:LogFile="%bindir%\Build.log";verbosity=diagnostic || goto :BuildFailed
msbuild %MSBuildAdditionalCommandLineArgs% /p:BootstrapBuildPath="%bindir%\Bootstrap" BuildAndTest.proj /p:Configuration=%BuildConfiguration% /p:Test64=%Test64% /p:TestVsi=%TestVsi% /p:RunProcessWatchdog=%RunProcessWatchdog% /p:BuildStartTime=%BuildStartTime% /p:"ProcDumpExe=%ProcDumpExe%" /p:BuildTimeLimit=%BuildTimeLimit% /p:PathMap="%RoslynRoot%=q:\roslyn" /p:Feature=pdb-path-determinism /fileloggerparameters:LogFile="%bindir%\Build.log";verbosity=diagnostic || goto :BuildFailed
powershell -noprofile -executionPolicy RemoteSigned -file "%RoslynRoot%\build\scripts\check-msbuild.ps1" "%bindir%\Build.log" || goto :BuildFailed
call :TerminateBuildProcesses
......
......@@ -209,7 +209,7 @@ commitPullList.each { isPr ->
mkdir %TEMP%
set TMP=%TEMP%
set VS150COMNTOOLS=%ProgramFiles(x86)%\\Microsoft Visual Studio\\VS15Preview\\Common7\\Tools\\
.\\cibuild.cmd /debug /testVSI""")
.\\cibuild.cmd /debug /testVsi""")
}
}
......
......@@ -15,17 +15,16 @@ internal struct TestExecutionOptions
internal string NoTrait { get; }
internal bool UseHtml { get; }
internal bool Test64 { get; }
internal bool TestVsi { get; }
internal bool TestVSI { get; }
internal TestExecutionOptions(string xunitPath, string trait, string noTrait, bool useHtml, bool test64, bool testVSI)
internal TestExecutionOptions(string xunitPath, string trait, string noTrait, bool useHtml, bool test64, bool testVsi)
{
XunitPath = xunitPath;
Trait = trait;
NoTrait = noTrait;
UseHtml = useHtml;
Test64 = test64;
TestVSI = testVSI;
TestVsi = testVsi;
}
}
......
......@@ -30,7 +30,7 @@ internal class Options
/// <summary>
/// Use the open integration test runner.
/// </summary>
public bool TestVSI { get; set; }
public bool TestVsi { get; set; }
/// <summary>
/// Allow the caching of test results.
......@@ -82,9 +82,9 @@ internal static Options Parse(string[] args)
opt.Test64 = true;
index++;
}
else if (comp.Equals(current, "-testVSI"))
else if (comp.Equals(current, "-testVsi"))
{
opt.TestVSI = true;
opt.TestVsi = true;
index++;
}
else if (comp.Equals(current, "-xml"))
......
......@@ -184,7 +184,7 @@ private static ITestExecutor CreateTestExecutor(Options options)
noTrait: options.NoTrait,
useHtml: options.UseHtml,
test64: options.Test64,
testVSI: options.TestVSI);
testVsi: options.TestVsi);
var processTestExecutor = new ProcessTestExecutor(testExecutionOptions);
if (!options.UseCachedResults)
{
......
......@@ -41,7 +41,7 @@ internal TestRunner(Options options, ITestExecutor testExecutor)
internal async Task<RunAllResult> RunAllAsync(IEnumerable<AssemblyInfo> assemblyInfoList, CancellationToken cancellationToken)
{
// Use 1.5 times the number of processors for unit tests, but only 1 processor for the open integration tests
var max = (_options.TestVSI) ? 1 : (int)(Environment.ProcessorCount * 1.5);
var max = (_options.TestVsi) ? 1 : (int)(Environment.ProcessorCount * 1.5);
var allPassed = true;
var cacheCount = 0;
var waiting = new Stack<AssemblyInfo>(assemblyInfoList);
......
......@@ -13,19 +13,19 @@ namespace Roslyn.VisualStudio.IntegrationTests
{
public abstract class AbstractEditorTest : AbstractIntegrationTest
{
protected readonly VisualStudioWorkspace_OutOfProc _visualStudioWorkspaceOutOfProc;
protected readonly Editor_OutOfProc _editor;
protected readonly VisualStudioWorkspace_OutOfProc VisualStudioWorkspaceOutOfProc;
protected readonly Editor_OutOfProc Editor;
protected AbstractEditorTest(VisualStudioInstanceFactory instanceFactory, string solutionName)
: base(instanceFactory)
{
_visualStudio.Instance.SolutionExplorer.CreateSolution(solutionName);
_visualStudio.Instance.SolutionExplorer.AddProject("TestProj", WellKnownProjectTemplates.ClassLibrary, LanguageName);
VisualStudio.Instance.SolutionExplorer.CreateSolution(solutionName);
VisualStudio.Instance.SolutionExplorer.AddProject("TestProj", WellKnownProjectTemplates.ClassLibrary, LanguageName);
_visualStudioWorkspaceOutOfProc = _visualStudio.Instance.VisualStudioWorkspace;
_visualStudioWorkspaceOutOfProc.SetUseSuggestionMode(false);
VisualStudioWorkspaceOutOfProc = VisualStudio.Instance.VisualStudioWorkspace;
VisualStudioWorkspaceOutOfProc.SetUseSuggestionMode(false);
_editor = _visualStudio.Instance.Editor;
Editor = VisualStudio.Instance.Editor;
ClearEditor();
}
......@@ -34,7 +34,7 @@ protected AbstractEditorTest(VisualStudioInstanceFactory instanceFactory, string
private void WaitForAsyncOperations(string featuresToWaitFor)
{
_visualStudioWorkspaceOutOfProc.WaitForAsyncOperations(featuresToWaitFor);
VisualStudioWorkspaceOutOfProc.WaitForAsyncOperations(featuresToWaitFor);
}
protected void ClearEditor()
......@@ -48,23 +48,23 @@ protected void SetUpEditor(string markupCode)
int caretPosition;
MarkupTestFile.GetPosition(markupCode, out code, out caretPosition);
var originalValue = _visualStudioWorkspaceOutOfProc.IsPrettyListingOn(LanguageName);
var originalValue = VisualStudioWorkspaceOutOfProc.IsPrettyListingOn(LanguageName);
_visualStudioWorkspaceOutOfProc.SetPrettyListing(LanguageName, false);
VisualStudioWorkspaceOutOfProc.SetPrettyListing(LanguageName, false);
try
{
_editor.SetText(code);
_editor.MoveCaret(caretPosition);
Editor.SetText(code);
Editor.MoveCaret(caretPosition);
}
finally
{
_visualStudioWorkspaceOutOfProc.SetPrettyListing(LanguageName, originalValue);
VisualStudioWorkspaceOutOfProc.SetPrettyListing(LanguageName, originalValue);
}
}
protected void SendKeys(params object[] keys)
{
_editor.SendKeys(keys);
Editor.SendKeys(keys);
}
protected KeyPress KeyPress(VirtualKey virtualKey, ShiftState shiftState)
......@@ -84,12 +84,12 @@ protected KeyPress Shift(VirtualKey virtualKey)
protected void DisableSuggestionMode()
{
_visualStudioWorkspaceOutOfProc.SetUseSuggestionMode(false);
VisualStudioWorkspaceOutOfProc.SetUseSuggestionMode(false);
}
protected void EnableSuggestionMode()
{
_visualStudioWorkspaceOutOfProc.SetUseSuggestionMode(true);
VisualStudioWorkspaceOutOfProc.SetUseSuggestionMode(true);
}
protected void InvokeCompletionList()
......@@ -100,7 +100,7 @@ protected void InvokeCompletionList()
protected void ExecuteCommand(string commandName)
{
_visualStudio.Instance.ExecuteCommand(commandName);
VisualStudio.Instance.ExecuteCommand(commandName);
}
private void VerifyCurrentLineTextAndAssertCaretPosition(string expectedText, bool trimWhitespace)
......@@ -116,7 +116,7 @@ private void VerifyCurrentLineTextAndAssertCaretPosition(string expectedText, bo
var expectedTextBeforeCaret = expectedText.Substring(0, caretStartIndex);
var expectedTextAfterCaret = expectedText.Substring(caretEndIndex);
var lineText = _editor.GetCurrentLineText();
var lineText = Editor.GetCurrentLineText();
if (trimWhitespace)
{
......@@ -155,7 +155,7 @@ protected void VerifyCurrentLineText(string expectedText, bool assertCaretPositi
}
else
{
var lineText = _editor.GetCurrentLineText();
var lineText = Editor.GetCurrentLineText();
if (trimWhitespace)
{
......@@ -181,12 +181,12 @@ private void VerifyTextContainsAndAssertCaretPosition(string expectedText)
var expectedTextWithoutCaret = expectedTextBeforeCaret + expectedTextAfterCaret;
var editorText = _editor.GetText();
var editorText = Editor.GetText();
Assert.Contains(expectedTextWithoutCaret, editorText);
var index = editorText.IndexOf(expectedTextWithoutCaret);
var caretPosition = _editor.GetCaretPosition();
var caretPosition = Editor.GetCaretPosition();
Assert.Equal(caretStartIndex + index, caretPosition);
}
......@@ -198,14 +198,14 @@ protected void VerifyTextContains(string expectedText, bool assertCaretPosition
}
else
{
var editorText = _editor.GetText();
var editorText = Editor.GetText();
Assert.Contains(expectedText, editorText);
}
}
protected void VerifyCompletionItemExists(params string[] expectedItems)
{
var completionItems = _editor.GetCompletionItems();
var completionItems = Editor.GetCompletionItems();
foreach (var expectedItem in expectedItems)
{
Assert.Contains(expectedItem, completionItems);
......@@ -214,24 +214,24 @@ protected void VerifyCompletionItemExists(params string[] expectedItems)
protected void VerifyCurrentCompletionItem(string expectedItem)
{
var currentItem = _editor.GetCurrentCompletionItem();
var currentItem = Editor.GetCurrentCompletionItem();
Assert.Equal(expectedItem, currentItem);
}
protected void VerifyCurrentSignature(Signature expectedSignature)
{
var currentSignature = _editor.GetCurrentSignature();
var currentSignature = Editor.GetCurrentSignature();
Assert.Equal(expectedSignature, currentSignature);
}
protected void VerifyCaretIsOnScreen()
{
Assert.True(_editor.IsCaretOnScreen());
Assert.True(Editor.IsCaretOnScreen());
}
protected void VerifyCompletionListIsActive(bool expected)
{
Assert.Equal(expected, _editor.IsCompletionActive());
Assert.Equal(expected, Editor.IsCompletionActive());
}
}
}
......@@ -8,16 +8,16 @@ namespace Roslyn.VisualStudio.IntegrationTests
{
public abstract class AbstractIntegrationTest : IDisposable
{
protected readonly VisualStudioInstanceContext _visualStudio;
protected readonly VisualStudioInstanceContext VisualStudio;
protected AbstractIntegrationTest(VisualStudioInstanceFactory instanceFactory)
{
_visualStudio = instanceFactory.GetNewOrUsedInstance(SharedIntegrationHostFixture.RequiredPackageIds);
VisualStudio = instanceFactory.GetNewOrUsedInstance(SharedIntegrationHostFixture.RequiredPackageIds);
}
public void Dispose()
{
_visualStudio.Dispose();
VisualStudio.Dispose();
}
protected void Wait(double seconds)
......
......@@ -13,62 +13,62 @@ public abstract class AbstractInteractiveWindowTest : AbstractIntegrationTest
private static readonly char[] LineSeparators = { '\r', '\n' };
protected readonly CSharpInteractiveWindow_OutOfProc _interactiveWindow;
protected readonly CSharpInteractiveWindow_OutOfProc InteractiveWindow;
protected AbstractInteractiveWindowTest(VisualStudioInstanceFactory instanceFactory)
: base(instanceFactory)
{
_interactiveWindow = _visualStudio.Instance.CSharpInteractiveWindow;
InteractiveWindow = VisualStudio.Instance.CSharpInteractiveWindow;
ClearInteractiveWindow();
}
protected void ClearInteractiveWindow()
{
_interactiveWindow.Initialize();
_interactiveWindow.ShowWindow();
_interactiveWindow.Reset();
InteractiveWindow.Initialize();
InteractiveWindow.ShowWindow();
InteractiveWindow.Reset();
}
protected void ClearReplText()
{
// Dismiss the pop-up (if any)
_visualStudio.Instance.ExecuteCommand(Edit_SelectionCancelCommand);
VisualStudio.Instance.ExecuteCommand(Edit_SelectionCancelCommand);
// Clear the line
_visualStudio.Instance.ExecuteCommand(Edit_SelectionCancelCommand);
VisualStudio.Instance.ExecuteCommand(Edit_SelectionCancelCommand);
}
protected void Reset(bool waitForPrompt = true)
{
_interactiveWindow.Reset(waitForPrompt: true);
InteractiveWindow.Reset(waitForPrompt: true);
}
protected void SubmitText(string text, bool waitForPrompt = true)
{
_interactiveWindow.SubmitText(text, waitForPrompt);
InteractiveWindow.SubmitText(text, waitForPrompt);
}
protected void VerifyLastReplOutput(string expectedReplOutput)
{
var lastReplOutput = _interactiveWindow.GetLastReplOutput();
var lastReplOutput = InteractiveWindow.GetLastReplOutput();
Assert.Equal(expectedReplOutput, lastReplOutput);
}
protected void VerifyLastReplOutputContains(string expectedReplOutput)
{
var lastReplOutput = _interactiveWindow.GetLastReplOutput();
var lastReplOutput = InteractiveWindow.GetLastReplOutput();
Assert.Contains(expectedReplOutput, lastReplOutput);
}
protected void VerifyLastReplOutputEndsWith(string expectedReplOutput)
{
var lastReplOutput = _interactiveWindow.GetLastReplOutput();
var lastReplOutput = InteractiveWindow.GetLastReplOutput();
Assert.EndsWith(expectedReplOutput, lastReplOutput);
}
protected void VerifyReplPromptConsistency(string prompt, string output)
{
var replText = _interactiveWindow.GetReplText();
var replText = InteractiveWindow.GetReplText();
var replTextLines = replText.Split(LineSeparators, StringSplitOptions.RemoveEmptyEntries);
foreach (var replTextLine in replTextLines)
......@@ -97,7 +97,7 @@ protected void VerifyReplPromptConsistency(string prompt, string output)
protected void WaitForReplOutput(string outputText)
{
_interactiveWindow.WaitForReplOutput(outputText);
InteractiveWindow.WaitForReplOutput(outputText);
}
}
}
......@@ -87,7 +87,7 @@ public async Task WpfInteraction()
g.Children.Add(b);
w.Content = g;");
await _visualStudio.Instance.ClickAutomationElementAsync(testValue.ToString(), recursive: true);
await VisualStudio.Instance.ClickAutomationElementAsync(testValue.ToString(), recursive: true);
WaitForReplOutput("Hello, World!");
VerifyLastReplOutput("Hello, World!");
......
......@@ -9,10 +9,14 @@ namespace Roslyn.VisualStudio.IntegrationTests
[CollectionDefinition(nameof(SharedIntegrationHostFixture))]
public sealed class SharedIntegrationHostFixture : ICollectionFixture<VisualStudioInstanceFactory>
{
public const string RoslynLanguageServicesPackageId = "0b5e8ddb-f12d-4131-a71d-77acc26a798f";
public const string VisualStudioIntegrationFrameworkPackageId = "d0122878-51f1-4b36-95ec-dec2079a2a84";
public const string MSBuildPackageId = "Microsoft.Component.MSBuild";
public const string Net46TargetingPackPackageId = "Microsoft.Net.Component.4.6.TargetingPack";
public const string PortableLibraryPackageId = "Microsoft.VisualStudio.Component.PortableLibrary";
public const string RoslynCompilerPackageId = "Microsoft.VisualStudio.Component.Roslyn.Compiler";
public const string RoslynLanguageServicesPackageId = "Microsoft.VisualStudio.Component.Roslyn.LanguageServices";
public const string VsSdkPackageId = "Microsoft.VisualStudio.Component.VSSDK";
public static readonly ImmutableHashSet<string> RequiredPackageIds = ImmutableHashSet.Create(VisualStudioIntegrationFrameworkPackageId, RoslynLanguageServicesPackageId);
public static readonly ImmutableHashSet<string> RequiredPackageIds = ImmutableHashSet.Create(MSBuildPackageId, Net46TargetingPackPackageId, PortableLibraryPackageId, RoslynCompilerPackageId, RoslynLanguageServicesPackageId, VsSdkPackageId);
// This class has no code, and is never created. Its purpose is simply
// to be the place to apply [CollectionDefinition] and all the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册