-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathAndroidApplicationEntryPointBase.cs
More file actions
40 lines (34 loc) · 1.46 KB
/
AndroidApplicationEntryPointBase.cs
File metadata and controls
40 lines (34 loc) · 1.46 KB
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.Threading.Tasks;
#nullable enable
namespace Microsoft.DotNet.XHarness.TestRunners.Common;
/// <summary>
/// Implementors should provide a text writter than will be used to
/// write the logging of the tests that are executed.
/// </summary>
public abstract class AndroidApplicationEntryPointBase : ApplicationEntryPoint
{
public abstract TextWriter? Logger { get; }
/// <summary>
/// Implementors should provide a full path in which the final
/// results of the test run will be written. This property must not
/// return null.
/// </summary>
public abstract string TestsResultsFinalPath { get; }
public override async Task RunAsync()
{
var options = ApplicationOptions.Current;
using TextWriter? resultsFileMaybe = options.EnableXml ? File.CreateText(TestsResultsFinalPath) : null;
await InternalRunAsync(options, Logger, resultsFileMaybe);
if (CoverageResultPath != null)
{
// Report the coverage path via stdout so the Instrumentation class can
// forward it as INSTRUMENTATION_RESULT: coverage-results-path=<path>
Console.WriteLine($"INSTRUMENTATION_RESULT: coverage-results-path={CoverageResultPath}");
}
}
}