mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
### Description <!-- Describe your changes. --> Update various test projects to .net8 from EOL frameworks. Replace the Xamarin based Android and iOS test projects with a MAUI based project that uses .net 8. Add new CoreML flags to C# bindings ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Remove usage of EOL frameworks.
48 lines
No EOL
1.4 KiB
C#
48 lines
No EOL
1.4 KiB
C#
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
// Based on https://github.com/mattleibow/DeviceRunners/tree/main/sample/SampleMauiApp
|
|
|
|
using DeviceRunners.VisualRunners;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
#if MODE_XHARNESS
|
|
using DeviceRunners.XHarness;
|
|
#endif
|
|
|
|
namespace Microsoft.ML.OnnxRuntime.Tests.MAUI;
|
|
|
|
public static class MauiProgram
|
|
{
|
|
public static MauiApp CreateMauiApp()
|
|
{
|
|
var builder = MauiApp.CreateBuilder();
|
|
builder
|
|
// .ConfigureUITesting()
|
|
#if MODE_XHARNESS
|
|
.UseXHarnessTestRunner(conf => conf
|
|
.AddTestAssembly(typeof(MauiProgram).Assembly)
|
|
.AddXunit())
|
|
#endif
|
|
.UseVisualTestRunner(conf => conf
|
|
//#if MODE_NON_INTERACTIVE_VISUAL
|
|
// .EnableAutoStart(true)
|
|
// .AddTcpResultChannel(new TcpResultChannelOptions
|
|
// {
|
|
// HostNames = ["localhost", "10.0.2.2"],
|
|
// Port = 16384,
|
|
// Formatter = new TextResultChannelFormatter(),
|
|
// Required = false
|
|
// })
|
|
//#endif
|
|
.AddConsoleResultChannel()
|
|
.AddTestAssembly(typeof(MauiProgram).Assembly)
|
|
.AddXunit());
|
|
|
|
#if DEBUG
|
|
builder.Logging.AddDebug();
|
|
#endif
|
|
|
|
return builder.Build();
|
|
}
|
|
} |