File: MauiProgram.cs

package info (click to toggle)
onnxruntime 1.21.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 333,732 kB
  • sloc: cpp: 3,153,079; python: 179,219; ansic: 109,131; asm: 37,791; cs: 34,424; perl: 13,070; java: 11,047; javascript: 6,330; pascal: 4,126; sh: 3,277; xml: 598; objc: 281; makefile: 59
file content (48 lines) | stat: -rw-r--r-- 1,383 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// 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();
    }
}