Пример #1
0
        static void BatchModeExecInternal(bool isValidating)
        {
            try
            {
                var sceneNameArg = UnityCustomCommandLineHandler.TryGetArgument("scenes");
                var sceneNames   = sceneNameArg == null ? new List <string>() : sceneNameArg.Split(',').ToList();

                var sceneDirArg = UnityCustomCommandLineHandler.TryGetArgument("sceneDirs");
                var dirNames    = sceneDirArg == null ? new List <string>() : sceneDirArg.Split(',').ToList();

                Assert.That(!sceneNames.IsEmpty() || !dirNames.IsEmpty());

                var allSceneNames = sceneNames.Concat(
                    StUtil.GetAllSceneNamesUnderneathFolders(dirNames)).ToList();

                Log.Trace("Scene Tester:  Testing {0} scenes: '{1}'",
                          allSceneNames.Count, allSceneNames.Join(", "));

                StWindow.Instance.RunScenes(allSceneNames, true, isValidating);
            }
            catch (Exception e)
            {
                Log.ErrorException(
                    "Failed when {0}!".Fmt(isValidating ? "running zenject validation" : "running startup tests"), e);

                EditorApplication.Exit(1);
            }
        }
Пример #2
0
        public static void TestScenesUnderneathFolder()
        {
            var allFolderPaths = ZenUnityEditorUtil.GetSelectedFolderPathsInProjectsTab().Select(relativePath =>
                                                                                                 Path.Combine(
                                                                                                     Directory.GetParent(Application.dataPath).FullName, relativePath)).ToHashSet().ToList();

            var allSceneNames = StUtil.GetAllSceneNamesUnderneathFolders(allFolderPaths);

            StWindow.Instance.RunScenes(allSceneNames, false, false);
        }