Skip to content

Commit

Permalink
Move authoring tests to test folder (#660)
Browse files Browse the repository at this point in the history
* Generate WinMD for types which extend composable types.

* Add WinUI test app to test composable types.

* Fix static classes, classes without default constructor, consume composable types in XAML, and add IManagedActivationFactory.

* Added comment and indenting changes.

* PR feedback.

* PR feedback.

* Move authoring tests to tests folder
  • Loading branch information
manodasanW committed Jan 11, 2021
1 parent 503fa19 commit 36f722d
Show file tree
Hide file tree
Showing 47 changed files with 52 additions and 52 deletions.
Expand Up @@ -3,39 +3,39 @@
<assemblyIdentity version="1.0.0.0" name="CppTestApp"/>
<file name="WinRT.Host.dll">
<activatableClass
name="AuthoringSample.BasicClass"
name="AuthoringTest.BasicClass"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomDictionary"
name="AuthoringTest.CustomDictionary"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomReadOnlyDictionary"
name="AuthoringTest.CustomReadOnlyDictionary"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomVector"
name="AuthoringTest.CustomVector"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomVectorView"
name="AuthoringTest.CustomVectorView"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomWWW"
name="AuthoringTest.CustomWWW"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.DisposableClass"
name="AuthoringTest.DisposableClass"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.StaticClass"
name="AuthoringTest.StaticClass"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.TestClass"
name="AuthoringTest.TestClass"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
</file>
Expand Down
Expand Up @@ -62,22 +62,22 @@
<ProjectReference Include="..\..\Projections\WinUI\WinUI.csproj">
<Project>{0a991d5f-bfee-4d2f-9aad-6ad06470a5df}</Project>
</ProjectReference>
<ProjectReference Include="..\WinRT.Host.Shim\WinRT.Host.Shim.csproj">
<ProjectReference Include="..\..\Authoring\WinRT.Host.Shim\WinRT.Host.Shim.csproj">
<Project>{0bb8f82d-874e-45aa-bca3-20ce0562164a}</Project>
</ProjectReference>
<ProjectReference Include="..\WinRT.Host\WinRT.Host.vcxproj">
<ProjectReference Include="..\..\Authoring\WinRT.Host\WinRT.Host.vcxproj">
<Project>{7e33bcb7-19c5-4061-981d-ba695322708a}</Project>
</ProjectReference>
<ProjectReference Include="..\..\WinRT.Runtime\WinRT.Runtime.csproj">
<Project>{25244ced-966e-45f2-9711-1f51e951ff89}</Project>
</ProjectReference>
<ProjectReference Include="..\AuthoringSample\AuthoringSample.csproj">
<ProjectReference Include="..\AuthoringTest\AuthoringTest.csproj">
<Project>{41e2a272-150f-42f5-ad40-047aad9088a0}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="AuthoringSample">
<HintPath>..\AuthoringSample\bin\$(_WinMDPlatform)\$(Configuration)\net5.0\AuthoringSample.winmd</HintPath>
<Reference Include="AuthoringTest">
<HintPath>..\AuthoringTest\bin\$(_WinMDPlatform)\$(Configuration)\net5.0\AuthoringTest.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
</ItemGroup>
Expand Down
File renamed without changes.
Expand Up @@ -15,6 +15,6 @@
#pragma pop_macro("X64")
#pragma pop_macro("X86")

#include <winrt/AuthoringSample.h>
#include <winrt/AuthoringTest.h>

#include "gtest/gtest.h"
Expand Up @@ -2,7 +2,7 @@

using namespace winrt;
using namespace Windows::Foundation;
using namespace AuthoringSample;
using namespace AuthoringTest;

TEST(AuthoringTest, Statics)
{
Expand Down Expand Up @@ -266,7 +266,7 @@ TEST(AuthoringTest, CustomTypes)
testClass.SetTypeToTestClass();
auto type = testClass.Type();
EXPECT_EQ(type.Kind, Windows::UI::Xaml::Interop::TypeKind::Metadata);
EXPECT_EQ(type.Name, L"AuthoringSample.TestClass");
EXPECT_EQ(type.Name, L"AuthoringTest.TestClass");
}

TEST(AuthoringTest, CustomDictionaryImplementations)
Expand Down Expand Up @@ -323,7 +323,7 @@ TEST(AuthoringTest, CustomDictionaryImplementations)
EXPECT_EQ(readOnlyDictionary.TryLookup(L"second").value(), basicStruct2);
EXPECT_FALSE(readOnlyDictionary.TryLookup(L"fourth").has_value());
Windows::Foundation::Collections::IMapView<hstring, AuthoringSample::BasicStruct> mapSplit1, mapSplit2;
Windows::Foundation::Collections::IMapView<hstring, AuthoringTest::BasicStruct> mapSplit1, mapSplit2;
readOnlyDictionary.Split(mapSplit1, mapSplit2);
EXPECT_NE(mapSplit1, nullptr);
EXPECT_NE(mapSplit2, nullptr);
Expand All @@ -332,7 +332,7 @@ TEST(AuthoringTest, CustomDictionaryImplementations)
EXPECT_TRUE(mapSplit2.HasKey(L"third"));
*/

Windows::Foundation::Collections::IMap<hstring, AuthoringSample::BasicStruct> map = dictionary;
Windows::Foundation::Collections::IMap<hstring, AuthoringTest::BasicStruct> map = dictionary;
map.Clear();
EXPECT_EQ(map.Size(), 0);
}
Expand Down
Expand Up @@ -26,7 +26,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Projections\Windows\Windows.csproj" />
<ProjectReference Include="..\..\Projections\WinUI\WinUI.csproj" />
<ProjectReference Include="..\WinRT.SourceGenerator\WinRT.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\Authoring\WinRT.SourceGenerator\WinRT.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\cswinrt\cswinrt.vcxproj" />
<ProjectReference Include="..\..\WinRT.Runtime\WinRT.Runtime.csproj" />
</ItemGroup>
Expand Down
Expand Up @@ -9,7 +9,7 @@
using Windows.Foundation;
using Windows.Foundation.Metadata;

namespace AuthoringSample
namespace AuthoringTest
{
public enum BasicEnum
{
Expand Down
Expand Up @@ -63,8 +63,8 @@
<Link>WinRT.Host.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\..\AuthoringSample\bin\$(_WinMDPlatform)\$(Configuration)\net5.0\AuthoringSample.dll">
<Link>AuthoringSample.dll</Link>
<Content Include="..\..\AuthoringTest\bin\$(_WinMDPlatform)\$(Configuration)\net5.0\AuthoringTest.dll">
<Link>AuthoringTest.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
Expand Up @@ -139,8 +139,8 @@
</None>
</ItemGroup>
<ItemGroup>
<Reference Include="AuthoringSample">
<HintPath>..\..\AuthoringSample\bin\$(_WinMDPlatform)\$(Configuration)\net5.0\AuthoringSample.winmd</HintPath>
<Reference Include="AuthoringTest">
<HintPath>..\..\AuthoringTest\bin\$(_WinMDPlatform)\$(Configuration)\net5.0\AuthoringTest.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Implementation>WinRT.Host.dll</Implementation>
</Reference>
Expand All @@ -158,14 +158,14 @@
<Project>{25244ced-966e-45f2-9711-1f51e951ff89}</Project>
<SetTargetFramework>TargetFramework=net5.0</SetTargetFramework>
</ProjectReference>
<ProjectReference Include="..\..\WinRT.Host.Shim\WinRT.Host.Shim.csproj">
<ProjectReference Include="..\..\..\Authoring\WinRT.Host.Shim\WinRT.Host.Shim.csproj">
<Project>{0bb8f82d-874e-45aa-bca3-20ce0562164a}</Project>
<SetTargetFramework>TargetFramework=net5.0</SetTargetFramework>
</ProjectReference>
<ProjectReference Include="..\..\WinRT.Host\WinRT.Host.vcxproj">
<ProjectReference Include="..\..\..\Authoring\WinRT.Host\WinRT.Host.vcxproj">
<Project>{7e33bcb7-19c5-4061-981d-ba695322708a}</Project>
</ProjectReference>
<ProjectReference Include="..\..\AuthoringSample\AuthoringSample.csproj">
<ProjectReference Include="..\..\AuthoringTest\AuthoringTest.csproj">
<Project>{41e2a272-150f-42f5-ad40-047aad9088a0}</Project>
</ProjectReference>
</ItemGroup>
Expand Down
Expand Up @@ -5,7 +5,7 @@
xmlns:local="using:AuthoringWinUITest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:custom="using:AuthoringSample"
xmlns:custom="using:AuthoringTest"
mc:Ignorable="d">

<custom:CustomStackPanel x:Name="myStackPanel" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
Expand Down
Expand Up @@ -6,7 +6,7 @@

using namespace winrt;
using namespace Microsoft::UI::Xaml;
using namespace AuthoringSample;
using namespace AuthoringTest;

namespace winrt::AuthoringWinUITest::implementation
{
Expand Down
Expand Up @@ -15,43 +15,43 @@

<file name="WinRT.Host.dll">
<activatableClass
name="AuthoringSample.BasicClass"
name="AuthoringTest.BasicClass"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.ButtonUtils"
name="AuthoringTest.ButtonUtils"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomButton"
name="AuthoringTest.CustomButton"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomDictionary"
name="AuthoringTest.CustomDictionary"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomReadOnlyDictionary"
name="AuthoringTest.CustomReadOnlyDictionary"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomVector"
name="AuthoringTest.CustomVector"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomVectorView"
name="AuthoringTest.CustomVectorView"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.CustomWWW"
name="AuthoringTest.CustomWWW"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.DisposableClass"
name="AuthoringTest.DisposableClass"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="AuthoringSample.TestClass"
name="AuthoringTest.TestClass"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
</file>
Expand Down
Expand Up @@ -21,4 +21,4 @@
#include <winrt/Microsoft.UI.Xaml.Media.h>
#include <winrt/Microsoft.UI.Xaml.Navigation.h>
#include <winrt/Microsoft.UI.Xaml.Shapes.h>
#include <winrt/AuthoringSample.h>
#include <winrt/AuthoringTest.h>
Expand Up @@ -14,6 +14,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\WinRT.SourceGenerator\WinRT.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
<ProjectReference Include="..\..\Authoring\WinRT.SourceGenerator\WinRT.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
</ItemGroup>
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions src/cswinrt.sln
Expand Up @@ -75,9 +75,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestHost.ProbeByClass", "Pr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinRT.SourceGenerator", "Authoring\WinRT.SourceGenerator\WinRT.SourceGenerator.csproj", "{E0C26D3A-504A-4826-BAE2-DE775F865B2A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthoringSample", "Authoring\AuthoringSample\AuthoringSample.csproj", "{41E2A272-150F-42F5-AD40-047AAD9088A0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthoringTest", "Tests\AuthoringTest\AuthoringTest.csproj", "{41E2A272-150F-42F5-AD40-047AAD9088A0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthoringConsumptionTest", "Authoring\AuthoringConsumptionTest\AuthoringConsumptionTest.vcxproj", "{0212A7C5-8D3F-443C-9EBC-1F28091FDF88}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthoringConsumptionTest", "Tests\AuthoringConsumptionTest\AuthoringConsumptionTest.vcxproj", "{0212A7C5-8D3F-443C-9EBC-1F28091FDF88}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{6DA854DB-57BF-4FDD-AFF6-F70C965F48F6}"
EndProject
Expand All @@ -92,11 +92,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_component_derived", "T
{13333A6F-6A4A-48CD-865C-0F65135EB018} = {13333A6F-6A4A-48CD-865C-0F65135EB018}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiagnosticTests", "Authoring\DiagnosticTests\DiagnosticTests.csproj", "{FC05C557-C974-4CB3-9DA7-BB5476710E91}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiagnosticTests", "Tests\DiagnosticTests\DiagnosticTests.csproj", "{FC05C557-C974-4CB3-9DA7-BB5476710E91}"
EndProject
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "AuthoringWinUITest (Package)", "Authoring\AuthoringWinUITest\AuthoringWinUITest (Package)\AuthoringWinUITest (Package).wapproj", "{75B1621F-EC51-4D77-BD7E-BEE576B3ADC9}"
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "AuthoringWinUITest (Package)", "Tests\AuthoringWinUITest\AuthoringWinUITest (Package)\AuthoringWinUITest (Package).wapproj", "{75B1621F-EC51-4D77-BD7E-BEE576B3ADC9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthoringWinUITest", "Authoring\AuthoringWinUITest\AuthoringWinUITest\AuthoringWinUITest.vcxproj", "{493C7729-2F21-4198-AB09-BDF56BF501D3}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthoringWinUITest", "Tests\AuthoringWinUITest\AuthoringWinUITest\AuthoringWinUITest.vcxproj", "{493C7729-2F21-4198-AB09-BDF56BF501D3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -520,13 +520,13 @@ Global
{0BB8F82D-874E-45AA-BCA3-20CE0562164A} = {DA5AE0BA-E43D-4282-BC80-807DDE0C22C0}
{EF3326B5-716F-41D2-AB30-4EFAB30955E2} = {6D41796B-9904-40B8-BBCB-40B2D1BAE44B}
{E0C26D3A-504A-4826-BAE2-DE775F865B2A} = {DA5AE0BA-E43D-4282-BC80-807DDE0C22C0}
{41E2A272-150F-42F5-AD40-047AAD9088A0} = {DA5AE0BA-E43D-4282-BC80-807DDE0C22C0}
{0212A7C5-8D3F-443C-9EBC-1F28091FDF88} = {DA5AE0BA-E43D-4282-BC80-807DDE0C22C0}
{41E2A272-150F-42F5-AD40-047AAD9088A0} = {CFB651EC-DAA4-4A11-ABCD-C77F90602EB5}
{0212A7C5-8D3F-443C-9EBC-1F28091FDF88} = {CFB651EC-DAA4-4A11-ABCD-C77F90602EB5}
{13333A6F-6A4A-48CD-865C-0F65135EB018} = {CFB651EC-DAA4-4A11-ABCD-C77F90602EB5}
{0080F6D1-AEC3-4F89-ADE1-3D22A7EBF99E} = {CFB651EC-DAA4-4A11-ABCD-C77F90602EB5}
{FC05C557-C974-4CB3-9DA7-BB5476710E91} = {DA5AE0BA-E43D-4282-BC80-807DDE0C22C0}
{75B1621F-EC51-4D77-BD7E-BEE576B3ADC9} = {DA5AE0BA-E43D-4282-BC80-807DDE0C22C0}
{493C7729-2F21-4198-AB09-BDF56BF501D3} = {DA5AE0BA-E43D-4282-BC80-807DDE0C22C0}
{FC05C557-C974-4CB3-9DA7-BB5476710E91} = {CFB651EC-DAA4-4A11-ABCD-C77F90602EB5}
{75B1621F-EC51-4D77-BD7E-BEE576B3ADC9} = {CFB651EC-DAA4-4A11-ABCD-C77F90602EB5}
{493C7729-2F21-4198-AB09-BDF56BF501D3} = {CFB651EC-DAA4-4A11-ABCD-C77F90602EB5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5AE8C9D7-2613-4E1A-A4F2-579BAC28D0A2}
Expand Down

0 comments on commit 36f722d

Please sign in to comment.