/// <summary>
        /// Test entry point
        /// </summary>
        public override void TickTest()
        {
            // create the build source
            UnrealBuildSource BuildSource = new UnrealBuildSource(this.ProjectName, ProjectFile, this.UnrealPath, UsesSharedBuildType, BuildPath, new string[] { "" });

            // check editor and statged info is valid
            CheckResult(BuildSource.EditorValid, "Editor build was invalid");
            CheckResult(BuildSource.BuildCount > 0, "staged build was invalid");

            // simple check with an editor role
            UnrealSessionRole EditorRole = new UnrealSessionRole(UnrealTargetRole.Editor, BuildHostPlatform.Current.Platform, UnrealTargetConfiguration.Development);

            List <string> Reasons = new List <string>();

            // Check the build source can support this role
            bool ContainsEditor = BuildSource.CanSupportRole(EditorRole, ref Reasons);

            CheckResult(ContainsEditor, "{0", string.Join(", ", Reasons));

            // now actually try to create it
            UnrealAppConfig Config = BuildSource.CreateConfiguration(EditorRole, new UnrealSessionRole[] { });

            CheckResult(Config != null, "Build source did not return a config for {0}", EditorRole.ToString());

            ValidateEditorConfig(Config, BuildSource);

            // Check all editor types (game, server, etc)
            TestBuildSourceForEditorTypes(BuildSource);

            // Test all monolithics that our base test says we support
            TestBuildSourceForMonolithics(BuildSource);

            MarkComplete();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        protected void TestInstallThenRun(UnrealBuildSource Build, UnrealTargetRole ProcessType, ITargetDevice Device, UnrealTargetConfiguration Config, UnrealOptions InOptions = null)
        {
            // create a config based on the passed in params

            UnrealSessionRole Role = new UnrealSessionRole(ProcessType, Device.Platform, Config, InOptions);

            Log.Info("Testing {0}", Role);

            UnrealAppConfig AppConfig = Build.CreateConfiguration(Role);

            if (!CheckResult(AppConfig != null, "Could not create config for {0} {1} with platform {2} from build.", Config, ProcessType, Device))
            {
                MarkComplete();
                return;
            }

            // Install the app on this device
            IAppInstall AppInstall = Device.InstallApplication(AppConfig);

            CheckResult(AppConfig != null, "Could not create AppInstall for {0} {1} with platform {2} from build.", Config, ProcessType, Device);


            DateTime StartTime = DateTime.Now;

            // Run the app and wait for either a timeout or it to exit
            IAppInstance AppProcess = AppInstall.Run();

            while (AppProcess.HasExited == false)
            {
                if ((DateTime.Now - StartTime).TotalSeconds > 60)
                {
                    break;
                }

                Thread.Sleep(1000);
            }

            // Check it didn't exit unexpectedly
            CheckResult(AppProcess.HasExited == false, "Failed to run {0} {1} with platform {2}", Config, ProcessType, Device);

            // but kill it
            AppProcess.Kill();

            // Check that it left behind some artifacts (minimum should be a log)
            int ArtifactCount = new DirectoryInfo(AppProcess.ArtifactPath).GetFiles("*", SearchOption.AllDirectories).Length;

            CheckResult(ArtifactCount > 0, "No artifacts on device!");
        }
        /// <summary>
        /// Tests that this BuildSource is capable of providing a config for all supported editor-based roles
        /// </summary>
        /// <param name="BuildSource"></param>
        void TestBuildSourceForEditorTypes(UnrealBuildSource BuildSource)
        {
            // create a config for all editor based types
            foreach (var E in Enum.GetValues(typeof(UnrealTargetRole)).Cast <UnrealTargetRole>())
            {
                if (E.UsesEditor())
                {
                    UnrealAppConfig Config = BuildSource.CreateConfiguration(new UnrealSessionRole(E, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development));

                    CheckResult(Config != null, "Editor config for {0} returned null!", E);
                    CheckResult(string.IsNullOrEmpty(Config.Name) == false, "No config name!");

                    ValidateEditorConfig(Config, BuildSource);
                }
            }
        }
        /// <summary>
        /// Tests that this BuildSource is capable of returning configs for all the roles,
        /// platforms, and configurations that our base class says it should support
        /// </summary>
        /// <param name="BuildSource"></param>
        /// <returns></returns>
        void TestBuildSourceForMonolithics(UnrealBuildSource BuildSource)
        {
            List <UnrealSessionRole> AllRoles = new List <UnrealSessionRole>();

            // Add a role for all supported clients on all supported configurations
            foreach (var Platform in SupportedClientPlatforms)
            {
                foreach (var Config in SupportedConfigurations)
                {
                    AllRoles.Add(new UnrealSessionRole(UnrealTargetRole.Client, Platform, Config));
                }
            }

            // Add a role for all supported servers on all supported configurations
            foreach (var Platform in SupportedServerPlatforms)
            {
                foreach (var Config in SupportedConfigurations)
                {
                    AllRoles.Add(new UnrealSessionRole(UnrealTargetRole.Server, Platform, Config));
                }
            }

            // Now check the build source can create all of these
            foreach (var Role in AllRoles)
            {
                List <string> Issues = new List <string>();
                bool          Result = BuildSource.CanSupportRole(Role, ref Issues);
                Issues.ForEach(S => Log.Error(S));
                CheckResult(Result, "Failed to get artifacts for {0}", Role);

                // now actually try to create it
                UnrealAppConfig Config = BuildSource.CreateConfiguration(Role);

                CheckResult(Config != null, "Build source did not return a config for {0}", Role.ToString());
            }
        }
        void TestClientPlatform(UnrealTargetPlatform Platform)
        {
            string GameName  = this.ProjectFile.FullName;
            string BuildPath = this.BuildPath;
            string DevKit    = this.DevkitName;

            if (GameName.Equals("OrionGame", StringComparison.OrdinalIgnoreCase) == false)
            {
                Log.Info("Skipping test {0} due to non-Orion project!", this);
                MarkComplete();
                return;
            }

            // create a new build
            UnrealBuildSource Build = new UnrealBuildSource(ProjectFile, this.UnrealPath, UsesSharedBuildType, BuildPath);

            // check it's valid
            if (!CheckResult(Build.BuildCount > 0, "staged build was invalid"))
            {
                MarkComplete();
                return;
            }

            // Create devices to run the client and server
            ITargetDevice ServerDevice = new TargetDeviceWindows("PC Server", Gauntlet.Globals.TempDir);
            ITargetDevice ClientDevice = null;

            if (Platform == UnrealTargetPlatform.PS4)
            {
                //ClientDevice = new TargetDevicePS4(this.PS4Name);
            }
            else
            {
                ClientDevice = new TargetDeviceWindows("PC Client", Gauntlet.Globals.TempDir);
            }

            UnrealAppConfig ServerConfig = Build.CreateConfiguration(new UnrealSessionRole(UnrealTargetRole.Server, ServerDevice.Platform, UnrealTargetConfiguration.Development));
            UnrealAppConfig ClientConfig = Build.CreateConfiguration(new UnrealSessionRole(UnrealTargetRole.Client, ClientDevice.Platform, UnrealTargetConfiguration.Development));

            if (!CheckResult(ServerConfig != null && ServerConfig != null, "Could not create configs!"))
            {
                MarkComplete();
                return;
            }

            ShortSoloOptions Options = new ShortSoloOptions();

            Options.ApplyToConfig(ClientConfig);
            Options.ApplyToConfig(ServerConfig);

            IAppInstall ClientInstall = ClientDevice.InstallApplication(ClientConfig);
            IAppInstall ServerInstall = ServerDevice.InstallApplication(ServerConfig);

            if (!CheckResult(ServerConfig != null && ServerConfig != null, "Could not create configs!"))
            {
                MarkComplete();
                return;
            }

            IAppInstance ClientInstance = ClientInstall.Run();
            IAppInstance ServerInstance = ServerInstall.Run();

            DateTime StartTime        = DateTime.Now;
            bool     RunWasSuccessful = true;

            while (ClientInstance.HasExited == false)
            {
                if ((DateTime.Now - StartTime).TotalSeconds > 800)
                {
                    RunWasSuccessful = false;
                    break;
                }
            }

            ClientInstance.Kill();
            ServerInstance.Kill();

            UnrealLogParser LogParser = new UnrealLogParser(ClientInstance.StdOut);

            UnrealLogParser.CallstackMessage ErrorInfo = LogParser.GetFatalError();
            if (ErrorInfo != null)
            {
                CheckResult(false, "FatalError - {0}", ErrorInfo.Message);
            }

            RunWasSuccessful = LogParser.HasRequestExit();

            CheckResult(RunWasSuccessful, "Failed to run for platform {0}", Platform);
        }