This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding beginning of Unit Test Framework from PTVS. StevDo Share conta…
…ins the nuget package from github.com/microsoft/visualstudio-testhost that we are using. Soon it will be on proper github but until then we will use the private share.
- Loading branch information
Showing
8 changed files
with
223 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Process
updated
20 files
+0 −1 | .gitignore | |
+2 −4 | src/Microsoft.R.Host.vcxproj | |
+2 −2 | src/Microsoft.R.Host.vcxproj.filters | |
+87 −0 | src/RPlotHost.cpp | |
+40 −0 | src/RPlotHost.h | |
+0 −7 | src/Rapi.h | |
+0 −83 | src/detours.cpp | |
+0 −7 | src/detours.h | |
+0 −7 | src/eval.h | |
+5 −5 | src/grdeviceside.cpp | |
+1 −1 | src/grdevicesxaml.cpp | |
+30 −44 | src/host.cpp | |
+2 −7 | src/host.h | |
+7 −21 | src/log.cpp | |
+1 −1 | src/log.h | |
+16 −14 | src/main.cpp | |
+0 −1 | src/packages.config | |
+7 −18 | src/r_util.cpp | |
+0 −1 | src/stdafx.h | |
+37 −0 | src/xamlbuilder.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
src/UnitTests/UI/Microsoft.UI.Test/Microsoft.UI.Test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{2BBB937B-EFD3-48AA-BEF8-05E203589D24}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Microsoft.UI.Test</RootNamespace> | ||
<AssemblyName>Microsoft.UI.Test</AssemblyName> | ||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> | ||
<IsCodedUITest>False</IsCodedUITest> | ||
<TestProjectType>UnitTest</TestProjectType> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
<EmbedInteropTypes>True</EmbedInteropTypes> | ||
</Reference> | ||
<Reference Include="envdte80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
<EmbedInteropTypes>True</EmbedInteropTypes> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudioTools.MockVsTests.14.0, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> | ||
<HintPath>..\..\..\..\NugetPackages\Microsoft.VisualStudioTools.TestUtilities.14.0.0.0.0\lib\net45\Microsoft.VisualStudioTools.MockVsTests.14.0.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudioTools.TestUtilities.14.0, Version=1.0.0.2015, Culture=neutral, processorArchitecture=x86"> | ||
<HintPath>..\..\..\..\NugetPackages\Microsoft.VisualStudioTools.TestUtilities.14.0.0.0.0\lib\net45\Microsoft.VisualStudioTools.TestUtilities.14.0.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudioTools.TestUtilities.UI.14.0, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> | ||
<HintPath>..\..\..\..\NugetPackages\Microsoft.VisualStudioTools.TestUtilities.14.0.0.0.0\lib\net45\Microsoft.VisualStudioTools.TestUtilities.UI.14.0.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="UIAutomationClient" /> | ||
<Reference Include="WindowsBase" /> | ||
</ItemGroup> | ||
<Choose> | ||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
</ItemGroup> | ||
</When> | ||
<Otherwise> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> | ||
</ItemGroup> | ||
</Otherwise> | ||
</Choose> | ||
<ItemGroup> | ||
<Compile Include="RConstants.cs" /> | ||
<Compile Include="UITests.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\..\..\PTVS\Common\Tests\Utilities.UI\TestUtilities.UI.csproj"> | ||
<Project>{e8150ebc-6b62-40bf-bf91-1dc60149b530}</Project> | ||
<Name>TestUtilities.UI</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Choose> | ||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
</When> | ||
</Choose> | ||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.UI.Test { | ||
public class RConstants { | ||
public const string TemplateLanguageName = "R"; | ||
public const string ProjectTemplate_EmptyProject = "EmptyProject.zip"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using EnvDTE80; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Microsoft.VisualStudioTools.TestUtilities.UI; | ||
|
||
namespace Microsoft.UI.Test { | ||
[TestClass] | ||
public class UITests { | ||
[TestMethod, Priority(1)] | ||
[HostType("VSTestHost"), TestCategory("Installed")] | ||
public void CreateNewScript() { | ||
using (var app = new VisualStudioApp()) { | ||
var project = app.CreateProject( | ||
RConstants.TemplateLanguageName, RConstants.ProjectTemplate_EmptyProject, | ||
System.IO.Path.GetTempPath(), "RTestProject"); | ||
app.OpenSolutionExplorer().SelectProject(project); | ||
using (var newItem = NewItemDialog.FromDte(app)) { | ||
AutomationWrapper.Select(newItem.ProjectTypes.FindItem("R Script")); | ||
newItem.FileName = "my-script.r"; | ||
newItem.OK(); | ||
} | ||
|
||
var document = app.GetDocument("my-script.r"); | ||
document.SetFocus(); | ||
document.Type("2 -> a"); | ||
Assert.AreEqual("2 -> a# R Script", document.Text); | ||
} | ||
} | ||
|
||
[TestMethod, Priority(1)] | ||
[HostType("VSTestHost"), TestCategory("Installed")] | ||
public void VerifyTemplateDirectories() { | ||
var languageName = RConstants.TemplateLanguageName; | ||
using (var app = new VisualStudioApp()) { | ||
var sln = (Solution2)app.Dte.Solution; | ||
|
||
foreach (var templateName in new[] { | ||
RConstants.ProjectTemplate_EmptyProject, | ||
}) { | ||
var templatePath = sln.GetProjectTemplate(templateName, languageName); | ||
Assert.IsTrue( | ||
File.Exists(templatePath) || Directory.Exists(templatePath), | ||
string.Format("Cannot find template '{0}' for language '{1}'", templateName, languageName) | ||
); | ||
Console.WriteLine("Found {0} at {1}", templateName, templatePath); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.VisualStudioTools.TestUtilities.14.0" version="0.0.0" targetFramework="net46" /> | ||
</packages> |