-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update maui devicetests from upstream
- Loading branch information
Showing
66 changed files
with
4,683 additions
and
2,786 deletions.
There are no files selected for viewing
35 changes: 18 additions & 17 deletions
35
test/MauiTestUtils/DeviceTests.Runners.SourceGen/CodeBehindGenerator.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 |
---|---|---|
@@ -1,27 +1,28 @@ | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen; | ||
|
||
[Generator] | ||
public class CodeBehindGenerator : ISourceGenerator | ||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen | ||
{ | ||
public void Initialize(GeneratorInitializationContext context) | ||
[Generator] | ||
public class CodeBehindGenerator : ISourceGenerator | ||
{ | ||
//#if DEBUG | ||
//if (!System.Diagnostics.Debugger.IsAttached) | ||
// System.Diagnostics.Debugger.Launch(); | ||
//#endif | ||
} | ||
public void Initialize(GeneratorInitializationContext context) | ||
{ | ||
//#if DEBUG | ||
//if (!System.Diagnostics.Debugger.IsAttached) | ||
// System.Diagnostics.Debugger.Launch(); | ||
//#endif | ||
} | ||
|
||
public void Execute(GeneratorExecutionContext context) | ||
{ | ||
if (!context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.TargetFramework", out var targetFramework)) | ||
return; | ||
public void Execute(GeneratorExecutionContext context) | ||
{ | ||
if (!context.AnalyzerConfigOptions.GlobalOptions.TryGetValue("build_property.TargetFramework", out var targetFramework)) | ||
return; | ||
|
||
context.Log($"TargetFramework: {targetFramework}"); | ||
context.Log($"TargetFramework: {targetFramework}"); | ||
|
||
var generator = new RunnerGenerator(context, targetFramework); | ||
var generator = new RunnerGenerator(context, targetFramework); | ||
|
||
generator?.Generate(); | ||
generator?.Generate(); | ||
} | ||
} | ||
} |
27 changes: 14 additions & 13 deletions
27
test/MauiTestUtils/DeviceTests.Runners.SourceGen/GeneratorDiagnostics.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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
using System.Diagnostics; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen; | ||
|
||
static class GeneratorDiagnostics | ||
namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen | ||
{ | ||
public static readonly DiagnosticDescriptor LoggingMessage = new DiagnosticDescriptor( | ||
id: "TST1001", | ||
title: "Logging Message", | ||
messageFormat: "{0}", | ||
category: "Logging", | ||
DiagnosticSeverity.Info, | ||
isEnabledByDefault: true); | ||
static class GeneratorDiagnostics | ||
{ | ||
public static readonly DiagnosticDescriptor LoggingMessage = new DiagnosticDescriptor( | ||
id: "TST1001", | ||
title: "Logging Message", | ||
messageFormat: "{0}", | ||
category: "Logging", | ||
DiagnosticSeverity.Info, | ||
isEnabledByDefault: true); | ||
|
||
[Conditional("DEBUG")] | ||
public static void Log(this GeneratorExecutionContext context, string message) => | ||
context.ReportDiagnostic(Diagnostic.Create(LoggingMessage, Location.None, message)); | ||
[Conditional("DEBUG")] | ||
public static void Log(this GeneratorExecutionContext context, string message) => | ||
context.ReportDiagnostic(Diagnostic.Create(LoggingMessage, Location.None, message)); | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...auiTestUtils/DeviceTests.Runners.SourceGen/TestUtils.DeviceTests.Runners.SourceGen.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
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,4 @@ | ||
global using Microsoft.Maui; | ||
global using Microsoft.Maui.Graphics; | ||
global using Microsoft.Maui.Handlers; | ||
global using Microsoft.Maui.Platform; |
Oops, something went wrong.