public override ExitCode Execute() { Globals.Params = new Gauntlet.Params(this.Params); UnrealTestOptions ContextOptions = new UnrealTestOptions(); AutoParam.ApplyDefaults(ContextOptions); ContextOptions.Project = "EngineTest"; ContextOptions.Namespaces = "EngineTest,Gauntlet.UnrealTest"; ContextOptions.UsesSharedBuildType = true; AutoParam.ApplyParams(ContextOptions, Globals.Params.AllArguments); return(RunTests(ContextOptions)); }
public override void TickTest() { TestAutoParamOptions Options = new TestAutoParamOptions(); // Test that default assignments work AutoParam.ApplyDefaults(Options); CheckResult(Options.StringParam == "StringDefault", "Parsing StringParam failed"); CheckResult(Options.StringProperty == "StringDefault", "Parsing StringProperty failed"); CheckResult(Options.InternalName == "InternalDefault", "Parsing InternalName failed"); CheckResult(Options.IntParam == 42, "Parsing IntParam failed"); CheckResult(Options.FloatParam == 1.0f, "Parsing FloatParam failed"); CheckResult(Options.BoolParam == false, "Parsing BoolParam failed"); CheckResult(Options.BoolParam == false, "Parsing BoolParam failed"); CheckResult(Options.SubParams.SubInt == 1, "Parsing SubParams failed"); CheckResult(Options.EnumParam == TestAutoParamEnum.FirstType, "Parsing EnumParam failed"); // Test that params are applied // set this and check it does not return to the default Options.UnspecifiedFloatParam = 99; string Params = "-stringparam=NewString -externalname=ExternalValue -intparam=84 -floatparam=2.0 -boolparam -subint=2 -enumparam=SecondType"; AutoParam.ApplyParams(Options, Params.Split('-').Select(S => S.Trim()).ToArray()); CheckResult(Options.StringParam == "NewString", "Parsing StringParam failed"); CheckResult(Options.StringProperty == "NewString", "Parsing StringProperty failed"); CheckResult(Options.InternalName == "ExternalValue", "Parsing InternalName failed"); CheckResult(Options.IntParam == 84, "Parsing IntParam failed"); CheckResult(Options.FloatParam == 2.0f, "Parsing FloatParam failed"); CheckResult(Options.BoolParam == true, "Parsing BoolParam failed"); CheckResult(Options.SubParams.SubInt == 2, "Parsing SubParams failed"); CheckResult(Options.UnspecifiedFloatParam == 99, "Parsing UnspecifiedFloatParam failed"); CheckResult(Options.EnumParam == TestAutoParamEnum.SecondType, "Parsing EnumParam failed"); // Test that multiple param names are supported Params = "-OtherExternalName=SecondName"; AutoParam.ApplyParams(Options, new string[] { "OtherExternalName=SecondName" }); CheckResult(Options.InternalName == "SecondName", "Parsing InternalName failed"); MarkComplete(); }
public override void TickTest() { // Grab the most recent Release build of Orion UnrealBuildSource Build = new UnrealBuildSource(this.ProjectName, this.ProjectFile, this.UnrealPath, this.UsesSharedBuildType, this.BuildPath); // create client and server riles UnrealSessionRole ClientRole = new UnrealSessionRole(UnrealTargetRole.Client, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development); UnrealSessionRole ServerRole = new UnrealSessionRole(UnrealTargetRole.Server, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development); // create configurations from the build UnrealAppConfig ClientConfig = Build.CreateConfiguration(ClientRole); UnrealAppConfig ServerConfig = Build.CreateConfiguration(ServerRole); UnrealOptions Options = new UnrealOptions(); // create some params string[] Params = new string[] { "nullrhi", "ResX=800", "ResY=600", "Map=FooMap", "epicapp=Prod", "buildidoverride=1111", "commonargs=-somethingcommon", "-clientargs=-somethingclient", "-serverargs=-somethingserver" }; // apply them to options AutoParam.ApplyParams(Options, Params); Options.ApplyToConfig(ClientConfig); Options.ApplyToConfig(ServerConfig); CheckResult(ClientConfig.CommandLine.Contains("-nullrhi"), "Client Arg not applied!"); CheckResult(ClientConfig.CommandLine.Contains("-ResX=800"), "Client Arg not applied!"); CheckResult(ClientConfig.CommandLine.Contains("-ResY=600"), "Client Arg not applied!"); CheckResult(ClientConfig.CommandLine.Contains("-somethingclient"), "Client Arg not applied!"); CheckResult(ServerConfig.CommandLine.Contains("-Map=FooMap") == false, "Server Arg incorrectly applied!"); CheckResult(ServerConfig.CommandLine.StartsWith("FooMap"), "Server Args not start with map!"); CheckResult(ServerConfig.CommandLine.Contains("-somethingserver"), "Server Arg not applied!"); CheckResult(ClientConfig.CommandLine.Contains("-buildidoverride=1111"), "Common Arg not applied!"); CheckResult(ClientConfig.CommandLine.Contains("-somethingcommon"), "Common Arg not applied!"); CheckResult(ServerConfig.CommandLine.Contains("-buildidoverride=1111"), "Common Arg not applied!"); CheckResult(ServerConfig.CommandLine.Contains("-somethingcommon"), "Common Arg not applied!"); MarkComplete(); }
public override ExitCode Execute() { // Cheat - if we can base everything off a single note, don't require users to specify it by appending it // to our global argument list List <string> ExpandedParams = new List <string>(this.Params); ExpandedParams.Add("test=EditorTestNode"); // save off these params Globals.Params = new Gauntlet.Params(ExpandedParams.ToArray()); // create test options and apply any params UnrealTestOptions ContextOptions = new UnrealTestOptions(); AutoParam.ApplyParamsAndDefaults(ContextOptions, Globals.Params.AllArguments); // These are fixed for this prohect ContextOptions.Project = "EngineTest"; ContextOptions.Namespaces = "EditorTest"; ContextOptions.Build = "Editor"; ContextOptions.UsesSharedBuildType = true; return(RunTests(ContextOptions)); }
public override ExitCode Execute() { Log.Level = Gauntlet.LogLevel.VeryVerbose; AutoParam.ApplyParamsAndDefaults(this, Environment.GetCommandLineArgs()); // Fix up any pathing issues (some implementations don't like backslashes i.e. xbox) Project = Project.Replace(@"\", "/"); Path = Path.Replace(@"\", "/"); UnrealTargetPlatform ParsedPlatform = UnrealTargetPlatform.Parse(Platform); UnrealTargetConfiguration ParseConfiguration = (UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), Configuration, true); DevicePool.Instance.AddDevices(ParsedPlatform, Devices, false); // Find sources for this platform (note some platforms have multiple sources for staged builds, packaged builds etc) IEnumerable <IFolderBuildSource> BuildSources = Gauntlet.Utils.InterfaceHelpers.FindImplementations <IFolderBuildSource>().Where(S => S.CanSupportPlatform(ParsedPlatform)); // Find all builds at the specified path IBuild Build = BuildSources.SelectMany(S => S.GetBuildsAtPath(Project, Path)).FirstOrDefault(); if (Build == null) { throw new AutomationException("No builds for platform {0} found at {1}", Platform, Path); } UnrealAppConfig Config = new UnrealAppConfig(); Config.Build = Build; Config.ProjectName = Project; Config.Configuration = ParseConfiguration; Config.CommandLine = Commandline; List <ITargetDevice> AcquiredDevices = new List <ITargetDevice>(); /* This seems redundant but it's the only way to grab the devices at this stage * Todo: This will only pass in devices that are powered on, find a way to grab off devices and power them on */ DevicePool.Instance.EnumerateDevices(new UnrealTargetConstraint(ParsedPlatform), Device => { if (!AcquiredDevices.Contains(Device)) { AcquiredDevices.Add(Device); } return(false); }); if (AcquiredDevices.Count == 0) { Log.Error("Failed to find any valid devices!"); return(ExitCode.Error_AppInstallFailed); } Log.Info("Beginning Installation!"); // Reserve our devices so nothing else can use them DevicePool.Instance.ReserveDevices(AcquiredDevices); foreach (ITargetDevice Device in AcquiredDevices) { if (!Device.IsAvailable) { Log.Info("{0} is not available, skipping", Device.Name); continue; } if (!Device.IsOn) { Log.Info("Powering on {0}", Device); Device.PowerOn(); } else if (Globals.Params.ParseParam("reboot")) { Log.Info("Rebooting {0}", Device); Device.Reboot(); } if (!Device.Connect()) { Log.Warning("Failed to connect to {0}", Device.Name); continue; } Log.Info("Installing {0} to {1}", Config.Build.ToString(), Device.Name); try { Device.InstallApplication(Config); } catch (AutomationException error) { Log.Error("Failed to install to {0} due to: {1}", Device.Name, error.ToString()); } Log.Info("Disconnecting from {0}", Device.Name); Device.Disconnect(); } // Release our saved devices DevicePool.Instance.ReleaseDevices(AcquiredDevices); return(ExitCode.Success); }