Exemplo n.º 1
0
 /// <summary>
 /// Constructor. This intentionally takes only a type as it's expected that code creating roles should do so via
 /// the configuration class and take care to append properties.
 /// </summary>
 /// <param name="InType"></param>
 public UnrealTestRole(UnrealTargetRole InType, UnrealTargetPlatform?InPlatformOverride)
 {
     Type                          = InType;
     PlatformOverride              = InPlatformOverride;
     CommandLine                   = string.Empty;
     MapOverride                   = string.Empty;
     ExplicitClientCommandLine     = string.Empty;
     Controllers                   = new List <string>();
     FilesToCopy                   = new List <UnrealFileToCopy>();
     AdditionalArtifactDirectories = new List <EIntendedBaseCopyDirectory>();
     RoleType                      = ERoleModifier.None;
     CommandLineParams             = new GauntletCommandLine();
 }
        /// <summary>
        /// Constructor taking optional params
        /// </summary>
        /// <param name="InType"></param>
        /// <param name="InPlatform"></param>
        /// <param name="InConfiguration"></param>
        /// <param name="InCommandLine"></param>
        /// <param name="InOptions"></param>
        public UnrealSessionRole(UnrealTargetRole InType, UnrealTargetPlatform?InPlatform, UnrealTargetConfiguration InConfiguration, string InCommandLine = null, IConfigOption <UnrealAppConfig> InOptions = null)
        {
            RoleType = InType;

            Platform      = InPlatform;
            Configuration = InConfiguration;
            MapOverride   = string.Empty;

            if (string.IsNullOrEmpty(InCommandLine))
            {
                CommandLine = string.Empty;
            }
            else
            {
                CommandLine = InCommandLine;
            }

            RequiredBuildFlags = BuildFlags.None;

            if (Globals.Params.ParseParam("dev") && !RoleType.UsesEditor())
            {
                RequiredBuildFlags |= BuildFlags.CanReplaceExecutable;
            }

            //@todo: for bulk/packaged builds, we should mark the platform as capable of these as we're catching global and not test specific flags
            // where we may be running parallel tests on multiple platforms
            if (InPlatform == UnrealTargetPlatform.Android || InPlatform == UnrealTargetPlatform.IOS)
            {
                if (Globals.Params.ParseParam("bulk"))
                {
                    RequiredBuildFlags |= BuildFlags.Bulk;
                }
                else
                {
                    RequiredBuildFlags |= BuildFlags.NotBulk;
                }
            }

            if (Globals.Params.ParseParam("packaged") && (InPlatform == UnrealTargetPlatform.Switch || InPlatform == UnrealTargetPlatform.XboxOne || InPlatform == UnrealTargetPlatform.PS4))
            {
                RequiredBuildFlags |= BuildFlags.Packaged;
            }


            Options           = InOptions;
            FilesToCopy       = new List <UnrealFileToCopy>();
            CommandLineParams = new GauntletCommandLine();
            RoleModifier      = ERoleModifier.None;
        }