onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Devices/TestResultData.cs
Brian Martin 6c236fd939 Merged PR 6622174: merge latest onnxruntime into dmldev
there was a merge conflict in onnxruntime/core/providers/dml/OperatorAuthorHelper/Common.h that required manual merging.

Related work items: #36867798
2021-10-30 19:59:33 +00: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();
}
}