-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++ UWP Reflection based discovery (#1336)
* C++ UWP Reflection based discovery * Read Exe path from AppxManifest * Adding test * Changing TestCase ID generation logic Please see comment in TestCase .cs file * Remove extra code from platform abstraction
- Loading branch information
1 parent
8db34de
commit 0a7475c
Showing
6 changed files
with
384 additions
and
3 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
33 changes: 33 additions & 0 deletions
33
src/Microsoft.TestPlatform.TestHostProvider/Hosting/AppxManifestFile.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,33 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.DesktopTestHostRuntimeProvider | ||
{ | ||
using System.IO; | ||
using System.Xml.Linq; | ||
|
||
/// <summary> Wrapper for an appxmanifest file. </summary> | ||
internal static class AppxManifestFile | ||
{ | ||
/// <summary> Gets the app's exe name. </summary> | ||
/// <param name="filePath"> | ||
/// AppxManifest filePath | ||
/// </param> | ||
/// <returns>ExecutableName</returns> | ||
public static string GetApplicationExecutableName(string filePath) | ||
{ | ||
if (File.Exists(filePath)) | ||
{ | ||
var doc = XDocument.Load(filePath); | ||
var ns = doc.Root.Name.Namespace; | ||
|
||
return doc.Element(ns + "Package"). | ||
Element(ns + "Applications"). | ||
Element(ns + "Application"). | ||
Attribute("Executable").Value; | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
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,75 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp build" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build"> | ||
<!-- | ||
THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS. | ||
Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file. | ||
For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727 | ||
--> | ||
<Identity Name="e7a3d303-9783-498c-9285-7474e1e66396" Publisher="CN=maban" Version="1.0.0.0" ProcessorArchitecture="x86" /> | ||
<mp:PhoneIdentity PhoneProductId="e7a3d303-9783-498c-9285-7474e1e66396" PhonePublisherId="00000000-0000-0000-0000-000000000000" /> | ||
<Properties> | ||
<DisplayName>UnitTestApp8</DisplayName> | ||
<PublisherDisplayName>maban</PublisherDisplayName> | ||
<Logo>Assets\StoreLogo.png</Logo> | ||
</Properties> | ||
<Dependencies> | ||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10586.0" MaxVersionTested="10.0.16299.0" /> | ||
<PackageDependency Name="Microsoft.VCLibs.140.00" MinVersion="14.0.25426.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" /> | ||
</Dependencies> | ||
<Resources> | ||
<Resource Language="EN-US" /> | ||
</Resources> | ||
<Applications> | ||
<Application Id="vstest.executionengine.universal.App" Executable="UnitTestApp8.exe" EntryPoint="UnitTestApp8.App"> | ||
<uap:VisualElements DisplayName="UnitTestApp8" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="UnitTestApp8" BackgroundColor="transparent"> | ||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" /> | ||
<uap:SplashScreen Image="Assets\SplashScreen.png" /> | ||
</uap:VisualElements> | ||
</Application> | ||
</Applications> | ||
<Capabilities> | ||
<Capability Name="internetClientServer" /> | ||
</Capabilities> | ||
<Extensions> | ||
<Extension Category="windows.activatableClass.inProcessServer"> | ||
<InProcessServer> | ||
<Path>CLRHost.dll</Path> | ||
<ActivatableClass ActivatableClassId="Microsoft.VisualStudio.TestPlatform.TestExecutor.WinRTCore.UnitTestClient" ThreadingModel="both" /> | ||
</InProcessServer> | ||
</Extension> | ||
<Extension Category="windows.activatableClass.inProcessServer"> | ||
<InProcessServer> | ||
<Path>CppUnitTestFramework_Executor_WindowsPhone.dll</Path> | ||
<ActivatableClass ActivatableClassId="CppUnitTestFramework_Executor_WindowsPhone.CppTestCase" ThreadingModel="both" /> | ||
<ActivatableClass ActivatableClassId="CppUnitTestFramework_Executor_WindowsPhone.TestResult" ThreadingModel="both" /> | ||
<ActivatableClass ActivatableClassId="CppUnitTestFramework_Executor_WindowsPhone.CTestRunner" ThreadingModel="both" /> | ||
</InProcessServer> | ||
</Extension> | ||
<Extension Category="windows.activatableClass.inProcessServer"> | ||
<InProcessServer> | ||
<Path>vstest_executionengine_platformbridge.dll</Path> | ||
<ActivatableClass ActivatableClassId="vstest_executionengine_platformbridge.MessageTransmitter" ThreadingModel="both" /> | ||
<ActivatableClass ActivatableClassId="vstest_executionengine_platformbridge.ServiceMain" ThreadingModel="both" /> | ||
<ActivatableClass ActivatableClassId="vstest_executionengine_platformbridge.NativeMethods" ThreadingModel="both" /> | ||
</InProcessServer> | ||
</Extension> | ||
</Extensions> | ||
<build:Metadata> | ||
<build:Item Name="cl.exe" Version="19.13.26009.0 built by: VCTOOLSREL" /> | ||
<build:Item Name="VisualStudio" Version="15.0" /> | ||
<build:Item Name="VisualStudioEdition" Value="Microsoft Visual Studio Enterprise 2017" /> | ||
<build:Item Name="OperatingSystem" Version="10.0.16299.15 (WinBuild.160101.0800)" /> | ||
<build:Item Name="Microsoft.Build.AppxPackage.dll" Version="15.0.27215.3002" /> | ||
<build:Item Name="ProjectGUID" Value="{f0aa89fc-5ffc-4a0b-819b-0bae6b341260}" /> | ||
<build:Item Name="ilc.exe" Version="1.4.24211.00 built by: PROJECTNGDR2" /> | ||
<build:Item Name="OptimizingToolset" Value="ilc.exe" /> | ||
<build:Item Name="UseDotNetNativeSharedAssemblyFrameworkPackage" Value="True" /> | ||
<build:Item Name="UniversalGenericsOptOut" Value="false" /> | ||
<build:Item Name="Microsoft.Windows.UI.Xaml.Build.Tasks.dll" Version="15.0.27215.3002" /> | ||
<build:Item Name="CppUnitTestFramework.Universal" Version="15.0" /> | ||
<build:Item Name="TestPlatform.Universal" Version="15.0" /> | ||
<build:Item Name="MakePri.exe" Version="10.0.16299.15 (WinBuild.160101.0800)" /> | ||
</build:Metadata> | ||
</Package> |
Oops, something went wrong.