Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Gauntlet/SelfTest/TestGauntlet.cs
Ryan Durand 9ef3748747 Updating copyrights for Engine Programs.
#rnx
#rb none
#jira none

#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869242 in //Fortnite/Release-12.00/... via CL 10869536
#ROBOMERGE-BOT: FORTNITE (Main -> Dev-EngineMerge) (v613-10869866)

[CL 10870955 by Ryan Durand in Main branch]
2019-12-26 23:01:54 -05:00

68 lines
1.7 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using AutomationTool;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Gauntlet
{
public class TestGauntlet : BuildCommand
{
[AutoParamWithNames("", "Test", "Tests")]
public string Tests;
[AutoParamWithNames("", "Group")]
public string Group;
[AutoParam(false)]
public bool Verbose;
public override ExitCode Execute()
{
AutoParam.ApplyParamsAndDefaults(this, Environment.GetCommandLineArgs());
if (Verbose)
{
Gauntlet.Log.Level = Gauntlet.LogLevel.Verbose;
}
IEnumerable<string> TestList = new string[0];
// If a group was specified...
if (Group.Length > 0)
{
// if a group was specified, find those tests
TestList = Utils.TestConstructor.GetTestNamesByGroup<ITestNode>(Group, new[] { "Gauntlet.SelfTest" });
}
else if (Tests.Length > 0)
{
// list of tests?
TestList = Tests.Split(',').Select(S => S.Trim());
}
else
{
// Ok, run everything!
TestList = Utils.TestConstructor.GetTestNamesByGroup<ITestNode>(null, new[] { "Gauntlet.SelfTest" });
}
// Create the list of tests
IEnumerable<ITestNode> Nodes = Utils.TestConstructor.ConstructTests<ITestNode, string[]>(TestList, null, new[] { "Gauntlet.SelfTest" });
// Create the test executor
var Executor = new TextExecutor();
TestExecutorOptions Options = new TestExecutorOptions();
AutoParam.ApplyParamsAndDefaults(Options, this.Params);
bool AllTestsPassed = Executor.ExecuteTests(Options, Nodes);
return AllTestsPassed ? ExitCode.Success : ExitCode.Error_TestFailure;
}
}
}