You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
45 lines
935 B
C#
45 lines
935 B
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using EpicGames.Core;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.Text.RegularExpressions;
|
|
|
|
#nullable enable
|
|
|
|
namespace AutomationUtils.Matchers
|
|
{
|
|
/// <summary>
|
|
/// Matcher for editor/UAT instances exiting with an error
|
|
/// </summary>
|
|
class ExitCodeEventMatcher : ILogEventMatcher
|
|
{
|
|
static readonly Regex s_pattern = new Regex(
|
|
@"Editor terminated with exit code -?[1-9]|(Error executing.+)(tool returned code)(.+)");
|
|
|
|
public LogEventMatch? Match(ILogCursor cursor)
|
|
{
|
|
int numLines = 0;
|
|
for (; ; )
|
|
{
|
|
if (cursor.IsMatch(numLines, s_pattern))
|
|
{
|
|
numLines++;
|
|
}
|
|
else
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (numLines > 0)
|
|
{
|
|
LogEventBuilder builder = new LogEventBuilder(cursor);
|
|
builder.MoveNext(numLines - 1);
|
|
return builder.ToMatch(LogEventPriority.Low, LogLevel.Error, KnownLogEvents.ExitCode);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|