onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Devices/TestResultData.cs
Scott McKay b5a652c578
Add Xamarin support (#9436)
Add Xamarin support to the ORT nuget packages.
  - Update C# code to support Xamarin builds for iOS and Android
  - refactor some things to split out common code
  - include iOS and Android ORT native shared library in native nuget package
2021-10-27 20:07:07 +10:00

47 lines
No EOL
1.5 KiB
C#

using System.Collections.Generic;
using System.Linq;
namespace Microsoft.ML.OnnxRuntime.Tests.Devices
{
public enum TestOutcome
{
Passed,
Failed,
Skipped,
NotRun
}
public class TestResultSummary
{
public int TestCount { get; set; }
public int Succeeded { get; set; }
public int Skipped { get; set; }
public int Failed { get; set; }
public int NotRun { get; set; }
public IList<TestResult> TestResults { get; set; }
public TestResultSummary() {}
public TestResultSummary(IList<TestResult> results)
{
TestResults = results == null ? new List<TestResult>() : results;
TestCount = TestResults.Count;
Succeeded = TestResults.Count(i => i.TestOutcome == TestOutcome.Passed);
Skipped = TestResults.Count(i => i.TestOutcome == TestOutcome.Skipped);
Failed = TestResults.Count(i => i.TestOutcome == TestOutcome.Failed);
NotRun = TestResults.Count(i => i.TestOutcome == TestOutcome.NotRun);
}
}
public class TestResult
{
public TestOutcome TestOutcome { get; set; } = TestOutcome.NotRun;
public string TestId { get; set; }
public string TestName { get; set; }
public string Duration { get; set; }
public string Output { get; set; }
[Newtonsoft.Json.JsonIgnore]
public string Outcome => TestOutcome.ToString().ToUpper();
}
}