-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Harness] Move the project templates out of the harness dir. (#8088)
Move the project templates to be a resource in the dll. That way we can move all the code outside of xharness and used it outside. This is not a fill refactor but a first step to decouple the bcl test generation from the xamarin-macios project. XHarness should not see a difference, everythign works and simply makes the dlls larger due to the new resources. The code is going to take into account that the mono team will want to use and unmanaged template with no dependencies on Xamarin.iOS and Xamarin.Mac.
- Loading branch information
1 parent
ed77f3b
commit 16a84bd
Showing
26 changed files
with
152 additions
and
98 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
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
99 changes: 32 additions & 67 deletions
99
tests/xharness/BCLTestImporter/BCLTestProjectGenerator.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
14 changes: 14 additions & 0 deletions
14
tests/xharness/BCLTestImporter/Templates/ITemplatedProject.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,14 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace Xharness.BCLTestImporter.Templates { | ||
// interface that represent a project that is created from a template. | ||
// The interface should be able to generate a project that will later be | ||
// used by the AppRunner to execute tests. | ||
public interface ITemplatedProject { | ||
Stream GetProjectTemplate (Platform platform); | ||
Stream GetProjectTemplate (WatchAppType appType); | ||
Stream GetPlistTemplate (Platform platform); | ||
Stream GetPlistTemplate (WatchAppType appType); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions
52
tests/xharness/BCLTestImporter/Templates/Managed/XamariniOSTemplate.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,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
namespace Xharness.BCLTestImporter.Templates.Managed { | ||
|
||
// template project that uses the Xamarin.iOS and Xamarin.Mac frameworks | ||
// to create a testing application for given xunit and nunit test assemblies | ||
public class XamariniOSTemplate : ITemplatedProject { | ||
static readonly Dictionary<Platform, string> plistTemplateMatches = new Dictionary<Platform, string> { | ||
{Platform.iOS, "Managed.iOS.plist.in"}, | ||
{Platform.TvOS, "Managed.tvOS.plist.in"}, | ||
{Platform.WatchOS, "Managed.watchOS.plist.in"}, | ||
{Platform.MacOSFull, "Managed.macOS.plist.in"}, | ||
{Platform.MacOSModern, "Managed.macOS.plist.in"}, | ||
}; | ||
static readonly Dictionary<Platform, string> projectTemplateMatches = new Dictionary<Platform, string> { | ||
{Platform.iOS, "Managed.iOS.csproj.in"}, | ||
{Platform.TvOS, "Managed.tvOS.csproj.in"}, | ||
{Platform.WatchOS, "Managed.watchOS.csproj.in"}, | ||
{Platform.MacOSFull, "Managed.macOS.csproj.in"}, | ||
{Platform.MacOSModern, "Managed.macOS.csproj.in"}, | ||
}; | ||
static readonly Dictionary<WatchAppType, string> watchOSProjectTemplateMatches = new Dictionary<WatchAppType, string> | ||
{ | ||
{ WatchAppType.App, "Managed.watchOS.App.csproj.in"}, | ||
{ WatchAppType.Extension, "Managed.watchOS.Extension.csproj.in"} | ||
}; | ||
|
||
|
||
|
||
static readonly Dictionary<WatchAppType, string> watchOSPlistTemplateMatches = new Dictionary<WatchAppType, string> { | ||
{WatchAppType.App, "Managed.watchOS.App.plist.in"}, | ||
{WatchAppType.Extension, "Managed.watchOS.Extension.plist.in"} | ||
}; | ||
|
||
Stream GetTemplateStream (string templateName) | ||
{ | ||
var name = GetType ().Assembly.GetManifestResourceNames ().Where (a => a.EndsWith (templateName, StringComparison.Ordinal)).FirstOrDefault (); | ||
return GetType ().Assembly.GetManifestResourceStream (name); | ||
} | ||
|
||
public Stream GetPlistTemplate (Platform platform) => GetTemplateStream (plistTemplateMatches [platform]); | ||
|
||
public Stream GetPlistTemplate (WatchAppType appType) => GetTemplateStream (watchOSPlistTemplateMatches [appType]); | ||
|
||
public Stream GetProjectTemplate (Platform platform) => GetTemplateStream (projectTemplateMatches [platform]); | ||
|
||
public Stream GetProjectTemplate (WatchAppType appType) => GetTemplateStream (watchOSProjectTemplateMatches [appType]); | ||
} | ||
} |
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
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
16a84bd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚧 Experimental DDFun pipeline
🔥 Device tests completed (Failed) on iOS-DDFun on Azure DevOps(iOS-DDFun) 🔥
Test results
14 tests failed, 136 tests passed.
Failed tests
16a84bd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Build was (probably) aborted
🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.11', Running XM tests on '10.10', Running XM tests on '10.10'' 🔥
✅ Build succeeded
✅ Packages:
✅ API Diff (from stable)
✅ API Diff (from PR only) (no change)
✅ Generator Diff (no change)
🔥 Xamarin.Mac tests on 10.11 failed: Xamarin.Mac tests on macOS 10.11 failed (xammac_tests) 🔥
🔥 Xamarin.Mac tests on 10.10 failed: Xamarin.Mac tests on macOS 10.10 failed (xammac_tests) 🔥
🔥 Test run failed 🔥
Test results
2 tests failed, 182 tests passed.
Failed tests