forked from microsoft/testfx
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added WinUI TestAdapter. (microsoft#813)
- Loading branch information
Showing
19 changed files
with
622 additions
and
20 deletions.
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
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,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<TestAdapterContent Include="$(MSBuildThisFileDirectory)..\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll"> | ||
<Link>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<Visible>False</Visible> | ||
</TestAdapterContent> | ||
<TestAdapterContent Include="$(MSBuildThisFileDirectory)..\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll"> | ||
<Link>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<Visible>False</Visible> | ||
</TestAdapterContent> | ||
<TestAdapterContent Include="$(MSBuildThisFileDirectory)Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll"> | ||
<Link>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<Visible>False</Visible> | ||
</TestAdapterContent> | ||
<TestAdapterContent Include="$(MSBuildThisFileDirectory)\Microsoft.TestPlatform.AdapterUtilities.dll"> | ||
<Link>Microsoft.TestPlatform.AdapterUtilities.dll</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<Visible>False</Visible> | ||
</TestAdapterContent> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<!-- Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory` | ||
behavior be default, package consumers can opt-out of this behavior | ||
by removing `@(TestAdapterContent)` from the `None` ItemGroup | ||
i.e. `<None Remove="@(TestAdapterContent)" />` --> | ||
<None Include="@(TestAdapterContent)" /> | ||
</ItemGroup> | ||
</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,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<EnableMSTestV2CopyResources Condition="$(EnableMSTestV2CopyResources) == ''">true</EnableMSTestV2CopyResources> | ||
</PropertyGroup> | ||
|
||
<Target Name="GetMSTestV2CultureHierarchy"> | ||
<!-- Only traversing 5 levels in the culture hierarchy. This is the maximum lenght for all cultures and should be sufficient to get to a culture name that maps to a resource folder we package. | ||
The root culture name for all cultures is invariant whose name is ''(empty) and the parent for invariant culture is invariant itself.(https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.parent(v=vs.110).aspx.) | ||
So the below code should not break build in any case. --> | ||
<ItemGroup> | ||
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Name)" /> | ||
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Name)"/> | ||
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Parent.Name)" Condition="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Parent.Name) != ''"/> | ||
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Parent.Parent.Name)" Condition="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Parent.Parent.Name) != ''"/> | ||
<CurrentUICultureHierarchy Include="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Parent.Parent.Parent.Name)" Condition="$([System.Globalization.CultureInfo]::CurrentUICulture.Parent.Parent.Parent.Parent.Name) != ''"/> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- Copy resources over to $(TargetDir) if this is a localized build. --> | ||
<Target Name="CopyMSTestV2Resources" BeforeTargets="PrepareForBuild" Condition="$(EnableMSTestV2CopyResources) == 'true'" DependsOnTargets="GetMSTestV2CultureHierarchy"> | ||
|
||
<PropertyGroup> | ||
<CurrentUICultureHierarchy>%(CurrentUICultureHierarchy.Identity)</CurrentUICultureHierarchy> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<MSTestV2Files Include="$(MSBuildThisFileDirectory)..\_common\*.dll" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="@(MSTestV2Files->'%(RootDir)%(Directory)$(CurrentUICultureHierarchy)\%(FileName).resources.dll')" | ||
Condition="Exists('%(RootDir)%(Directory)$(CurrentUICultureHierarchy)\%(FileName).resources.dll')"> | ||
<Link>$(CurrentUICultureHierarchy)\%(FileName).resources.dll</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<BaseAssemblyFullPath>%(FullPath)</BaseAssemblyFullPath> | ||
<Visible>False</Visible> | ||
</Content> | ||
</ItemGroup> | ||
</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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
// Friend assemblies | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.WinUI.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] |
102 changes: 102 additions & 0 deletions
102
src/Adapter/PlatformServices.WinUI/PlatformServices.WinUI.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,102 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\..\</TestFxRoot> | ||
<FrameworkIdentifier>NetCore</FrameworkIdentifier> | ||
</PropertyGroup> | ||
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" /> | ||
<PropertyGroup> | ||
<RootNamespace>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</RootNamespace> | ||
<AssemblyName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</AssemblyName> | ||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework> | ||
|
||
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion> | ||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> | ||
<SupportedOSPlatformVersion>$(TargetPlatformMinVersion)</SupportedOSPlatformVersion> | ||
|
||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | ||
<UseSharedResources>true</UseSharedResources> | ||
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> | ||
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Constants.cs"> | ||
<Link>Constants.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10ReflectionOperations.cs"> | ||
<Link>Services\ns10ReflectionOperations.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10DiaSessionOperations.cs"> | ||
<Link>Services\ns10DiaSessionOperations.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10TestContextImplementation.cs"> | ||
<Link>Services\ns10TestContextImplementation.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10TestDataSource.cs"> | ||
<Link>Services\ns10TestDataSource.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\Services\ns13TestDeployment.cs"> | ||
<Link>Services\ns13TestDeployment.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\Utilities\ns13DeploymentItemUtility.cs" Link="Utilities\ns13DeploymentItemUtility.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\Utilities\ns13DeploymentUtilityBase.cs" Link="Utilities\ns13DeploymentUtilityBase.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\Utilities\ns13FileUtility.cs" Link="Utilities\ns13FileUtility.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\Services\ns13MSTestAdapterSettings.cs" Link="Services\ns13MSTestAdapterSettings.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\ns13DeploymentItem.cs" Link="Deployment\ns13DeploymentItem.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Utilities\ns10Validate.cs" Link="Utilities\ns10Validate.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\Extensions\ns13ExceptionExtensions.cs" Link="Extensions\ns13ExceptionExtensions.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10MSTestSettingsProvider.cs" Link="Services\ns10MSTestSettingsProvider.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\ns10RecursiveDirectoryPath.cs" Link="ns10RecursiveDirectoryPath.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10TestContextPropertyStrings.cs" Link="Services\ns10TestContextPropertyStrings.cs" /> | ||
<Compile Include="..\PlatformServices.NetCore\Utilities\NetCoreReflectionUtility.cs" Link="Utilities\NetCoreReflectionUtility.cs"/> | ||
<Compile Include="..\PlatformServices.NetCore\Utilities\NetCoreDeploymentUtility.cs" Link="Utilities\NetCoreDeploymentUtility.cs"/> | ||
<Compile Include="..\PlatformServices.NetCore\Deployment\NetCoreTestRunDirectories.cs" Link="Deployment\NetCoreTestRunDirectories.cs" /> | ||
<Compile Include="..\PlatformServices.NetCore\Utilities\NetCoreAssemblyUtility.cs" Link="Utilities\NetCoreAssemblyUtility.cs" /> | ||
<Compile Include="..\PlatformServices.NetCore\Services\NetCoreTestSourceHost.cs" Link="Services\NetCoreTestSourceHost.cs" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10ThreadOperations.cs"> | ||
<Link>Services\ns10ThreadOperations.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10TraceListener.cs"> | ||
<Link>Services\ns10TraceListener.cs</Link> | ||
</Compile> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.0\Services\ns10TraceListenerManager.cs"> | ||
<Link>Services\ns10TraceListenerManager.cs</Link> | ||
</Compile> | ||
<Compile Include="Friends.cs" /> | ||
<Compile Include="Services\WinUIAdapterTraceLogger.cs" /> | ||
<Compile Include="Services\WinUIFileOperations.cs" /> | ||
<Compile Include="Services\WinUITestSource.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Folder Include="Resources\" /> | ||
<Compile Include="..\PlatformServices.Shared\netstandard1.3\Resources\Resource.Designer.cs"> | ||
<Link>Resources\Resource.Designer.cs</Link> | ||
<AutoGen>True</AutoGen> | ||
<DesignTime>True</DesignTime> | ||
<DependentUpon>Resource.resx</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="..\PlatformServices.Shared\netstandard1.3\Resources\Resource.resx"> | ||
<Link>Resources\Resource.resx</Link> | ||
<Generator>ResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resource.Designer.cs</LastGenOutput> | ||
<SubType>Designer</SubType> | ||
<CustomToolNamespace>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices</CustomToolNamespace> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="$(TestPlatformVersion)" /> | ||
<PackageReference Include="System.Diagnostics.TextWriterTraceListener" Version="4.3.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\TestFramework\Extension.Core\Extension.Core.csproj" /> | ||
<ProjectReference Include="..\..\TestFramework\MSTest.Core\MSTest.Core.csproj" /> | ||
<ProjectReference Include="..\PlatformServices.Interface\PlatformServices.Interface.csproj" /> | ||
<ProjectReference Include="..\..\TestFramework\Extension.Core\Extension.Core.csproj" /> | ||
<ProjectReference Include="..\..\TestFramework\MSTest.Core\MSTest.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" /> | ||
</Project> |
34 changes: 34 additions & 0 deletions
34
src/Adapter/PlatformServices.WinUI/Properties/AssemblyInfo.cs
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,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
|
||
// This is set by GlobalAssemblyInfo which is auto-generated due to import of Microbuild.Settings.targets | ||
// [assembly: AssemblyVersion("1.0.0.0")] | ||
// [assembly: AssemblyFileVersion("1.0.0.0")] | ||
[assembly: ComVisible(false)] | ||
|
||
[assembly: TypeForwardedTo(typeof(SerializableAttribute))] | ||
[assembly: TypeForwardedTo(typeof(MarshalByRefObject))] |
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 @@ | ||
This file is kept to commit Resources directory as language specific resx files needs to be copied here. |
Oops, something went wrong.