Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/LowLevelTests/Utility/LowLevelTests.ReportParser.cs
chris constantinescu ae281656f2 Tests converted from 18848115 made to work multi-platform.
Not all were converted because they were designed for packaged applications whereas low level tests are designed to run as "native" non-packaged applications.
- reporting support for non-desktop platforms, for the moment Catch2 report type "console" is used that is sent to a .out file
- most number of tests possible running multi platform, slower tests excluded on incremental builds
- slow tests are moved to run on the monolithic build
- Catch2 report failure event listener such that Horde detects them as build errors. Must add new Horde matcher for Catch2 failures

#rb Mark.Lintott
#preflight 623c8de389625f0612dabd64

[CL 19498448 by chris constantinescu in ue5-main branch]
2022-03-24 13:28:25 -04:00

57 lines
1.6 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using Gauntlet;
using System;
using System.Linq;
using System.Xml.Linq;
namespace LowLevelTests
{
public class LowLevelTestsReportParser
{
private XDocument ReportDoc;
public bool IsValid { get; protected set; }
public LowLevelTestsReportParser(string InLocalReportPath)
{
try
{
ReportDoc = XDocument.Load(InLocalReportPath);
IsValid = true;
}
catch (Exception LoadEx)
{
Log.Error("Encountered error while loading report {0}", LoadEx.ToString());
IsValid = false;
}
}
public bool HasPassed()
{
if (!IsValid)
{
return false;
}
int NrOverallResultsFailures = -1;
int NrOverallResultsSuccesses = -1;
int NrOverallResultsCasesFailures = -1;
int NrOverallResultsCasesSuccesses = -1;
XElement OverallResults = ReportDoc.Descendants("OverallResults").FirstOrDefault();
if (OverallResults != null)
{
NrOverallResultsFailures = int.Parse(OverallResults.Attribute("failures").Value);
NrOverallResultsSuccesses = int.Parse(OverallResults.Attribute("successes").Value);
}
XElement OverallResultsCases = ReportDoc.Descendants("OverallResultsCases").FirstOrDefault();
if (OverallResultsCases != null)
{
NrOverallResultsCasesFailures = int.Parse(OverallResultsCases.Attribute("failures").Value);
NrOverallResultsCasesSuccesses = int.Parse(OverallResultsCases.Attribute("successes").Value);
}
return NrOverallResultsFailures == 0 && NrOverallResultsCasesFailures == 0 && NrOverallResultsSuccesses > 0 && NrOverallResultsCasesSuccesses > 0;
}
}
}