Exemplo n.º 1
0
        private static void BuildAndRun(BuildTarget target, List <string> testScenes, List <string> otherBuildScenes)
        {
            var resultFilePath = GetParameterArgument(k_ResultFileDirParam);

            const int port   = 0;
            var       ipList = TestRunnerConfigurator.GetAvailableNetworkIPs();

            var config = new PlatformRunnerConfiguration
            {
                buildTarget            = target,
                buildScenes            = otherBuildScenes,
                testScenes             = testScenes,
                projectName            = "IntegrationTests",
                resultsDir             = resultFilePath,
                sendResultsOverNetwork = InternalEditorUtility.inBatchMode,
                ipList = ipList,
                port   = port
            };

            // Commented out because unused and was trigerring compilation issue
            // starting at version 2018
//#if !UNITY_2017
//			if (Application.isWebPlayer)
//			{
//				config.sendResultsOverNetwork = false;
//				Debug.Log("You can't use WebPlayer as active platform for running integration tests. Switching to Standalone");
//				EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);
//			}
//#endif
            PlatformRunner.BuildAndRunInPlayer(config);
        }
Exemplo n.º 2
0
        private static void RunInEditor(List <string> sceneList)
        {
            CheckActiveBuildTarget();

            NetworkResultsReceiver.StopReceiver();
            if (sceneList == null || sceneList.Count == 0)
            {
                Debug.Log("No scenes on the list");
                EditorApplication.Exit(returnCodeRunError);
                return;
            }
            EditorBuildSettings.scenes = sceneList.Select(s => new EditorBuildSettingsScene(s, true)).ToArray();
            EditorApplication.OpenScene(sceneList.First());
            GuiHelper.SetConsoleErrorPause(false);

            var config = new PlatformRunnerConfiguration
            {
                resultsDir  = GetParameterArgument(k_ResultFileDirParam),
                ipList      = TestRunnerConfigurator.GetAvailableNetworkIPs(),
                port        = PlatformRunnerConfiguration.TryToGetFreePort(),
                runInEditor = true,
            };

            var settings = new PlayerSettingConfigurator(true);

            settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs()));

            NetworkResultsReceiver.StartReceiver(config);

            EditorApplication.isPlaying = true;
        }
Exemplo n.º 3
0
        private static void BuildAndRun(BuildTarget target, List <string> testScenes, List <string> otherBuildScenes)
        {
            var resultFilePath = GetParameterArgument(k_ResultFileDirParam);

            const int port   = 0;
            var       ipList = TestRunnerConfigurator.GetAvailableNetworkIPs();

            var config = new PlatformRunnerConfiguration
            {
                buildTarget            = target,
                buildScenes            = otherBuildScenes,
                testScenes             = testScenes,
                projectName            = "IntegrationTests",
                resultsDir             = resultFilePath,
                sendResultsOverNetwork = InternalEditorUtility.inBatchMode,
                ipList = ipList,
                port   = port
            };

            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                config.sendResultsOverNetwork = false;
                Debug.Log("You can't use WebPlayer as active platform for running integration tests. Switching to Standalone");
#if UNITY_5_6_OR_NEWER
                EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows);
#else
                EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);
#endif
            }

            PlatformRunner.BuildAndRunInPlayer(config);
        }
Exemplo n.º 4
0
        private static void BuildAndRun(BuildTarget target, List <string> testScenes, List <string> otherBuildScenes)
        {
            var resultFilePath = GetParameterArgument(k_ResultFileDirParam);

            const int port   = 0;
            var       ipList = TestRunnerConfigurator.GetAvailableNetworkIPs();

            var config = new PlatformRunnerConfiguration
            {
                buildTarget            = target,
                buildScenes            = otherBuildScenes,
                testScenes             = testScenes,
                projectName            = "IntegrationTests",
                resultsDir             = resultFilePath,
                sendResultsOverNetwork = InternalEditorUtility.inBatchMode,
                ipList = ipList,
                port   = port
            };


            // WebPlayer support has been removed since Unity 5.4
//            if (Application.isWebPlayer)
//            {
//                config.sendResultsOverNetwork = false;
//                Debug.Log("You can't use WebPlayer as active platform for running integration tests. Switching to Standalone");
//                EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);
//            }

            PlatformRunner.BuildAndRunInPlayer(config);
        }
        private void BuildAndRun()
        {
            SaveToPreferences();

            var config = new PlatformRunnerConfiguration
            {
                buildTarget            = m_BuildTarget,
                buildScenes            = m_OtherScenesToBuild,
                testScenes             = m_IntegrationTestScenes,
                projectName            = m_IntegrationTestScenes.Count > 1 ? "IntegrationTests" : Path.GetFileNameWithoutExtension(SceneManager.GetActiveScene().path),
                resultsDir             = m_Settings.resultsPath,
                sendResultsOverNetwork = m_Settings.sendResultsOverNetwork,
                ipList = m_Interfaces.Skip(1).ToList(),
                port   = m_Settings.port
            };

            if (m_SelectedInterface > 0)
            {
                config.ipList = new List <string> {
                    m_Interfaces.ElementAt(m_SelectedInterface)
                }
            }
            ;

            PlatformRunner.BuildAndRunInPlayer(config);
            Close();
        }
Exemplo n.º 6
0
		private static void BuildAndRun (BuildTarget target, List<string> sceneList)
		{
			var resultFilePath = GetParameterArgument (resultFileDirParam);

			int port = 0;
			List<string> ipList = TestRunnerConfigurator.GetAvailableNetworkIPs ();

			var config = new PlatformRunnerConfiguration ()
			{
				buildTarget = target,
				scenes = sceneList.ToArray (),
				projectName = "IntegrationTests",
				resultsDir = resultFilePath,
				sendResultsOverNetwork = InternalEditorUtility.inBatchMode,
				ipList = ipList,
				port = port
			};

			if (Application.isWebPlayer)
			{
				config.sendResultsOverNetwork = false;
				Debug.Log ("You can't use WebPlayer as active platform for running integraiton tests. Switching to Standalone");
				EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);
			}

			PlatformRunner.BuildAndRunInPlayer (config);
		}
        public static void StartReceiver(PlatformRunnerConfiguration configuration)
        {
            var w = (NetworkResultsReceiver)GetWindow(typeof(NetworkResultsReceiver), false);

            w.SetConfiguration(configuration);
            w.Show(true);
        }
Exemplo n.º 8
0
        private static void BuildAndRun(BuildTarget target, List <string> sceneList)
        {
            var resultFilePath = GetParameterArgument(k_ResultFileDirParam);

            const int port   = 0;
            var       ipList = TestRunnerConfigurator.GetAvailableNetworkIPs();

            var config = new PlatformRunnerConfiguration
            {
                buildTarget            = target,
                scenes                 = sceneList.ToArray(),
                projectName            = "IntegrationTests",
                resultsDir             = resultFilePath,
                sendResultsOverNetwork = InternalEditorUtility.inBatchMode,
                ipList                 = ipList,
                port = port
            };

            if (Application.isWebPlayer)
            {
                config.sendResultsOverNetwork = false;
                Debug.Log("You can't use WebPlayer as active platform for running integration tests. Switching to Standalone");
                EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows);
            }

            PlatformRunner.BuildAndRunInPlayer(config);
        }
Exemplo n.º 9
0
        private static void RunInEditor(List <string> testScenes, List <string> otherBuildScenes)
        {
            CheckActiveBuildTarget();

            // Steve V. 2016 - This causes exceptions and it's a feature I don't care about
            //NetworkResultsReceiver.StopReceiver();

            if (testScenes == null || testScenes.Count == 0)
            {
                Debug.Log("No test scenes on the list");
                EditorApplication.Exit(returnCodeRunError);
                return;
            }
            EditorBuildSettings.scenes = (testScenes.Concat(otherBuildScenes).ToList()).Select(s => new EditorBuildSettingsScene(s, true)).ToArray();
            EditorApplication.OpenScene(testScenes.First());
            GuiHelper.SetConsoleErrorPause(false);

            var config = new PlatformRunnerConfiguration
            {
                resultsDir  = GetParameterArgument(k_ResultFileDirParam),
                ipList      = TestRunnerConfigurator.GetAvailableNetworkIPs(),
                port        = PlatformRunnerConfiguration.TryToGetFreePort(),
                runInEditor = true
            };

            var settings = new PlayerSettingConfigurator(true);

            settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs()));

            // Steve V. 2016 - This causes exceptions and it's a feature I don't care about
            //NetworkResultsReceiver.StartReceiver(config);

            EditorApplication.isPlaying = true;
        }
        public static void BuildAndRunInPlayer(PlatformRunnerConfiguration configuration)
        {
            NetworkResultsReceiver.StopReceiver();

            var settings = new PlayerSettingConfigurator(false);

            if (configuration.sendResultsOverNetwork)
            {
                try
                {
                    var l = new TcpListener(IPAddress.Any, configuration.port);
                    l.Start();
                    configuration.port = ((IPEndPoint)l.Server.LocalEndPoint).Port;
                    l.Stop();
                }
                catch (SocketException e)
                {
                    Debug.LogException(e);
                    if (InternalEditorUtility.inBatchMode)
                        EditorApplication.Exit(Batch.returnCodeRunError);
                }
            }

            if (InternalEditorUtility.inBatchMode)
                settings.AddConfigurationFile(TestRunnerConfigurator.batchRunFileMarker, "");

            if (configuration.sendResultsOverNetwork)
                settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork,
                                              string.Join("\n", configuration.GetConnectionIPs()));

            settings.AddConfigurationFile (TestRunnerConfigurator.testScenesToRun, string.Join ("\n", configuration.testScenes.ToArray()));

            settings.ChangeSettingsForIntegrationTests();

            AssetDatabase.Refresh();

            var result = BuildPipeline.BuildPlayer(configuration.testScenes.Concat(configuration.buildScenes).ToArray(),
                                                   configuration.GetTempPath(),
                                                   configuration.buildTarget,
                                                   BuildOptions.AutoRunPlayer | BuildOptions.Development);

            settings.RevertSettingsChanges();
            settings.RemoveAllConfigurationFiles();

            AssetDatabase.Refresh();

            if (!string.IsNullOrEmpty(result))
            {
                if (InternalEditorUtility.inBatchMode)
                    EditorApplication.Exit(Batch.returnCodeRunError);
                return;
            }

            if (configuration.sendResultsOverNetwork)
                NetworkResultsReceiver.StartReceiver(configuration);
            else if (InternalEditorUtility.inBatchMode)
                EditorApplication.Exit(Batch.returnCodeTestsOk);
        }
 public static void StartReceiver(PlatformRunnerConfiguration configuration)
 {
     var w = (NetworkResultsReceiver)GetWindow(typeof(NetworkResultsReceiver), false);
     w.SetConfiguration(configuration);
     if (!EditorApplication.isCompiling)
     {
         w.EnableServer();
     }
     w.Show(true);
 }
Exemplo n.º 12
0
        public static void StartReceiver(PlatformRunnerConfiguration configuration)
        {
            var w = (NetworkResultsReceiver)GetWindow(typeof(NetworkResultsReceiver), false);

            w.SetConfiguration(configuration);
            if (!EditorApplication.isCompiling)
            {
                w.EnableServer();
            }
            w.Show(true);
        }
Exemplo n.º 13
0
        private static void RunInEditor(List <string> testScenes, List <string> otherBuildScenes)
        {
            CheckActiveBuildTarget();

            NetworkResultsReceiver.StopReceiver();
            if (testScenes == null || testScenes.Count == 0)
            {
                Debug.Log("No test scenes on the list");
                EditorApplication.Exit(returnCodeRunError);
                return;
            }

            string previousScenesXml = "";
            var    serializer        = new System.Xml.Serialization.XmlSerializer(typeof(EditorBuildSettingsScene[]));

            using (StringWriter textWriter = new StringWriter())
            {
                serializer.Serialize(textWriter, EditorBuildSettings.scenes);
                previousScenesXml = textWriter.ToString();
            }

            EditorBuildSettings.scenes = (testScenes.Concat(otherBuildScenes).ToList()).Select(s => new EditorBuildSettingsScene(s, true)).ToArray();

#if UNITY_5_3_OR_NEWER
            EditorSceneManager.OpenScene(testScenes.First());
#else
            EditorApplication.LoadLevelInPlayMode(testScenes.First());
#endif
            GuiHelper.SetConsoleErrorPause(false);

            var config = new PlatformRunnerConfiguration
            {
                resultsDir  = GetParameterArgument(k_ResultFileDirParam),
                ipList      = TestRunnerConfigurator.GetAvailableNetworkIPs(),
                port        = PlatformRunnerConfiguration.TryToGetFreePort(),
                runInEditor = true
            };

            var settings = new PlayerSettingConfigurator(true);
            settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs()));
            settings.AddConfigurationFile(TestRunnerConfigurator.testScenesToRun, string.Join("\n", testScenes.ToArray()));
            settings.AddConfigurationFile(TestRunnerConfigurator.previousScenes, previousScenesXml);

            NetworkResultsReceiver.StartReceiver(config);

            EditorApplication.isPlaying = true;
        }
Exemplo n.º 14
0
        private static void BuildAndRun(BuildTarget target, List <string> testScenes, List <string> otherBuildScenes)
        {
            var resultFilePath = GetParameterArgument(k_ResultFileDirParam);

            const int port   = 0;
            var       ipList = TestRunnerConfigurator.GetAvailableNetworkIPs();

            var config = new PlatformRunnerConfiguration
            {
                buildTarget            = target,
                buildScenes            = otherBuildScenes,
                testScenes             = testScenes,
                projectName            = "IntegrationTests",
                resultsDir             = resultFilePath,
                sendResultsOverNetwork = InternalEditorUtility.inBatchMode,
                ipList = ipList,
                port   = port
            };

            PlatformRunner.BuildAndRunInPlayer(config);
        }
Exemplo n.º 15
0
 private void SetConfiguration(PlatformRunnerConfiguration configuration)
 {
     m_Configuration = configuration;
 }
        public void OnGUI()
        {
            EditorGUILayout.BeginVertical();

            EditorGUILayout.LabelField("List of scenes to build:", EditorStyles.boldLabel);
            m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition, Styles.testList);
            EditorGUI.indentLevel++;
            foreach (var scenePath in m_SceneList)
            {
                var path = Path.GetFileNameWithoutExtension(scenePath);
                var guiContent = new GUIContent(path, scenePath);
                var rect = GUILayoutUtility.GetRect(guiContent, EditorStyles.label);
                if (rect.Contains(Event.current.mousePosition))
                {
                    if (Event.current.type == EventType.mouseDown && Event.current.button == 0)
                    {
						if (!Event.current.control && !Event.current.command)
                            m_SelectedScenes.Clear();
                        if (!m_SelectedScenes.Contains(scenePath))
                            m_SelectedScenes.Add(scenePath);
                        else
                            m_SelectedScenes.Remove(scenePath);
                        Event.current.Use();
                    }
                }
                var style = new GUIStyle(EditorStyles.label);
                if (m_SelectedScenes.Contains(scenePath))
                    style.normal.textColor = new Color(0.3f, 0.5f, 0.85f);
                EditorGUI.LabelField(rect, guiContent, style);
            }
            EditorGUI.indentLevel--;
            EditorGUILayout.EndScrollView();

            GUILayout.Space(3);

            m_BuildTarget = (BuildTarget)EditorGUILayout.EnumPopup("Build tests for", m_BuildTarget);

            if (PlatformRunner.defaultBuildTarget != m_BuildTarget)
            {
                if (GUILayout.Button("Make default target platform"))
                {
                    PlatformRunner.defaultBuildTarget = m_BuildTarget;
                }
            }
            DrawSetting();
            var build = GUILayout.Button("Build and run tests");
            EditorGUILayout.EndVertical();

            if (!build) return;

            var config = new PlatformRunnerConfiguration
            {
                buildTarget = m_BuildTarget,
                scenes = m_SelectedScenes.ToArray(),
                projectName = m_SelectedScenes.Count > 1 ? "IntegrationTests" : Path.GetFileNameWithoutExtension(EditorApplication.currentScene),
                resultsDir = m_Settings.resultsPath,
                sendResultsOverNetwork = m_Settings.sendResultsOverNetwork,
                ipList = m_Interfaces.Skip(1).ToList(),
                port = m_Settings.port
            };

            if (m_SelectedInterface > 0)
                config.ipList = new List<string> {m_Interfaces.ElementAt(m_SelectedInterface)};

            PlatformRunner.BuildAndRunInPlayer(config);
            Close();
        }
 private void SetConfiguration(PlatformRunnerConfiguration configuration)
 {
     m_Configuration = configuration;
 }
 public static void StartReceiver(PlatformRunnerConfiguration configuration)
 {
     var w = (NetworkResultsReceiver)GetWindow(typeof(NetworkResultsReceiver), false);
     w.SetConfiguration(configuration);
     w.Show(true);
 }
Exemplo n.º 19
0
		private static void RunInEditor (List<string> sceneList)
		{
			NetworkResultsReceiver.StopReceiver ();
			if (sceneList == null || sceneList.Count == 0)
			{
				Debug.Log ("No scenes on the list");
				EditorApplication.Exit(RETURN_CODE_RUN_ERROR);
				return;
			}
			EditorBuildSettings.scenes = sceneList.Select (s => new EditorBuildSettingsScene (s, true)).ToArray ();
			EditorApplication.OpenScene (sceneList.First ());
			GuiHelper.SetConsoleErrorPause (false);

			var config = new PlatformRunnerConfiguration()
			{
				resultsDir = GetParameterArgument(resultFileDirParam),
				ipList = TestRunnerConfigurator.GetAvailableNetworkIPs(),
				port = PlatformRunnerConfiguration.TryToGetFreePort (),
			};

			var settings = new PlayerSettingConfigurator(true);
			settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs()));

			NetworkResultsReceiver.StartReceiver(config);

			EditorApplication.isPlaying = true;
		}
Exemplo n.º 20
0
        public static void BuildAndRunInPlayer(PlatformRunnerConfiguration configuration)
        {
            NetworkResultsReceiver.StopReceiver();

            var settings = new PlayerSettingConfigurator(false);

            if (configuration.sendResultsOverNetwork)
            {
                try
                {
                    var l = new TcpListener(IPAddress.Any, configuration.port);
                    l.Start();
                    configuration.port = ((IPEndPoint)l.Server.LocalEndPoint).Port;
                    l.Stop();
                }
                catch (SocketException e)
                {
                    Debug.LogException(e);
                    if (InternalEditorUtility.inBatchMode)
                    {
                        EditorApplication.Exit(Batch.returnCodeRunError);
                    }
                }
            }

            if (InternalEditorUtility.inBatchMode)
            {
                settings.AddConfigurationFile(TestRunnerConfigurator.batchRunFileMarker, "");
            }

            if (configuration.sendResultsOverNetwork)
            {
                settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork,
                                              string.Join("\n", configuration.GetConnectionIPs()));
            }

            settings.AddConfigurationFile(TestRunnerConfigurator.testScenesToRun, string.Join("\n", configuration.testScenes.ToArray()));

            settings.ChangeSettingsForIntegrationTests();

            AssetDatabase.Refresh();

            var result = BuildPipeline.BuildPlayer(configuration.testScenes.Concat(configuration.buildScenes).ToArray(),
                                                   configuration.GetTempPath(),
                                                   configuration.buildTarget,
                                                   BuildOptions.AutoRunPlayer | BuildOptions.Development);

            settings.RevertSettingsChanges();
            settings.RemoveAllConfigurationFiles();

            AssetDatabase.Refresh();

            if (!string.IsNullOrEmpty(result))
            {
                if (InternalEditorUtility.inBatchMode)
                {
                    EditorApplication.Exit(Batch.returnCodeRunError);
                }
                return;
            }

            if (configuration.sendResultsOverNetwork)
            {
                NetworkResultsReceiver.StartReceiver(configuration);
            }
            else if (InternalEditorUtility.inBatchMode)
            {
                EditorApplication.Exit(Batch.returnCodeTestsOk);
            }
        }
        private void BuildAndRun()
        {
            SaveToPreferences ();

            var config = new PlatformRunnerConfiguration
            {
                buildTarget = m_BuildTarget,
                buildScenes = m_OtherScenesToBuild,
                testScenes = m_IntegrationTestScenes,
                projectName = m_IntegrationTestScenes.Count > 1 ? "IntegrationTests" : Path.GetFileNameWithoutExtension(SceneManager.GetActiveScene().path),
                resultsDir = m_Settings.resultsPath,
                sendResultsOverNetwork = m_Settings.sendResultsOverNetwork,
                ipList = m_Interfaces.Skip(1).ToList(),
                port = m_Settings.port
            };

            if (m_SelectedInterface > 0)
            config.ipList = new List<string> {m_Interfaces.ElementAt(m_SelectedInterface)};

            PlatformRunner.BuildAndRunInPlayer(config);
            Close ();
        }
Exemplo n.º 22
0
        private static void RunInEditor(List<string> testScenes, List<string> otherBuildScenes)
        {
            CheckActiveBuildTarget();

            NetworkResultsReceiver.StopReceiver();
            if (testScenes == null || testScenes.Count == 0)
            {
                Debug.Log("No test scenes on the list");
                EditorApplication.Exit(returnCodeRunError);
                return;
            }

            string previousScenesXml = "";
            var serializer = new System.Xml.Serialization.XmlSerializer(typeof(EditorBuildSettingsScene[]));
            using(StringWriter textWriter = new StringWriter())
            {
                serializer.Serialize(textWriter, EditorBuildSettings.scenes);
                previousScenesXml = textWriter.ToString();
            }

            EditorBuildSettings.scenes = (testScenes.Concat(otherBuildScenes).ToList()).Select(s => new EditorBuildSettingsScene(s, true)).ToArray();
            EditorSceneManager.OpenScene(testScenes.First());
            GuiHelper.SetConsoleErrorPause(false);

            var config = new PlatformRunnerConfiguration
            {
                resultsDir = GetParameterArgument(k_ResultFileDirParam),
                ipList = TestRunnerConfigurator.GetAvailableNetworkIPs(),
                port = PlatformRunnerConfiguration.TryToGetFreePort(),
                runInEditor = true
            };

            var settings = new PlayerSettingConfigurator(true);
            settings.AddConfigurationFile(TestRunnerConfigurator.integrationTestsNetwork, string.Join("\n", config.GetConnectionIPs()));
            settings.AddConfigurationFile(TestRunnerConfigurator.testScenesToRun, string.Join ("\n", testScenes.ToArray()));
            settings.AddConfigurationFile(TestRunnerConfigurator.previousScenes, previousScenesXml);

            NetworkResultsReceiver.StartReceiver(config);

            EditorApplication.isPlaying = true;
        }
Exemplo n.º 23
0
        public void OnGUI()
        {
            EditorGUILayout.BeginVertical();

            EditorGUILayout.LabelField("List of scenes to build:", EditorStyles.boldLabel);
            m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition, Styles.testList);
            EditorGUI.indentLevel++;
            foreach (var scenePath in m_SceneList)
            {
                var path       = Path.GetFileNameWithoutExtension(scenePath);
                var guiContent = new GUIContent(path, scenePath);
                var rect       = GUILayoutUtility.GetRect(guiContent, EditorStyles.label);
                if (rect.Contains(Event.current.mousePosition))
                {
                    if (Event.current.type == EventType.mouseDown && Event.current.button == 0)
                    {
                        if (!Event.current.control && !Event.current.command)
                        {
                            m_SelectedScenes.Clear();
                        }
                        if (!m_SelectedScenes.Contains(scenePath))
                        {
                            m_SelectedScenes.Add(scenePath);
                        }
                        else
                        {
                            m_SelectedScenes.Remove(scenePath);
                        }
                        Event.current.Use();
                    }
                }
                var style = new GUIStyle(EditorStyles.label);
                if (m_SelectedScenes.Contains(scenePath))
                {
                    style.normal.textColor = new Color(0.3f, 0.5f, 0.85f);
                }
                EditorGUI.LabelField(rect, guiContent, style);
            }
            EditorGUI.indentLevel--;
            EditorGUILayout.EndScrollView();

            GUILayout.Space(3);

            m_BuildTarget = (BuildTarget)EditorGUILayout.EnumPopup("Build tests for", m_BuildTarget);

            if (PlatformRunner.defaultBuildTarget != m_BuildTarget)
            {
                if (GUILayout.Button("Make default target platform"))
                {
                    PlatformRunner.defaultBuildTarget = m_BuildTarget;
                }
            }
            DrawSetting();
            var build = GUILayout.Button("Build and run tests");

            EditorGUILayout.EndVertical();

            if (!build)
            {
                return;
            }

            var config = new PlatformRunnerConfiguration
            {
                buildTarget            = m_BuildTarget,
                scenes                 = m_SelectedScenes.ToArray(),
                projectName            = m_SelectedScenes.Count > 1 ? "IntegrationTests" : Path.GetFileNameWithoutExtension(EditorApplication.currentScene),
                resultsDir             = m_Settings.resultsPath,
                sendResultsOverNetwork = m_Settings.sendResultsOverNetwork,
                ipList                 = m_Interfaces.Skip(1).ToList(),
                port = m_Settings.port
            };

            if (m_SelectedInterface > 0)
            {
                config.ipList = new List <string> {
                    m_Interfaces.ElementAt(m_SelectedInterface)
                }
            }
            ;

            PlatformRunner.BuildAndRunInPlayer(config);
            Close();
        }