Ejemplo n.º 1
0
 private void RunTests()
 {
     var filter = new TestFilter();
     var categories = m_FilterSettings.GetSelectedCategories();
     if (categories != null && categories.Length > 0)
         filter.categories = categories;
     RunTests(filter);
 }
Ejemplo n.º 2
0
        private void RunTests() {
            var filter = new TestFilter();
            var categories = GetSelectedCategories();

            if (categories != null && categories.Length > 0)
            { filter.categories = categories; }

            RunTests(filter);
        }
Ejemplo n.º 3
0
		private static TestFilter GetTestFilter ()
		{
			var testFilterArg = GetParameterArgumentArray (testFilterParam);
			var testCategoryArg = GetParameterArgumentArray (categoryParam);
			var filter = new TestFilter ()
			{
				names = testFilterArg,
				categories = testCategoryArg
			};
			return filter;
		}
Ejemplo n.º 4
0
        private void RunTests(TestFilter filter) {
            string currentScene = null;
            int undoGroup = -1;

            for (int i = 0; i < 3; ++i) {
                //if (runTestOnANewScene)
                //{
                //if (autoSaveSceneBeforeRun)
                //	EditorApplication.SaveScene ();

                //if (!EditorApplication.SaveCurrentSceneIfUserWantsTo ())
                //	return;
                //}
                failedTestCount = 0;

                if (runTestOnANewScene)
                { currentScene = OpenNewScene(); }

                else
                { undoGroup = RegisterUndo(); }

                string strInfo = "";

                if (testXmlFormat && i == 0) {
                    strInfo = "Xml";

                } else if (testBsonFormat && i == 1) {
                    strInfo = "Bson";

                } else if (testCSharpFormat && i == 2) {
                    strInfo = "CSharp";

                } else {
                    continue;
                }

                UnitTestView.Format = strInfo;
                StartTestRun(filter, new TestRunnerEventListener(UpdateTestInfo));

                if (failedTestCount > 0) {
                    Debug.LogError(strInfo + " Format test failed!");
                    break;
                }
            }

            if (runTestOnANewScene)
            { LoadPreviousScene(currentScene); }

            else
            { PerformUndo(undoGroup); }
        }
Ejemplo n.º 5
0
        private void RunTests(TestFilter filter)
        {
            if (m_Settings.runTestOnANewScene)
            {
                if (m_Settings.autoSaveSceneBeforeRun) EditorApplication.SaveScene();
                if (!EditorApplication.SaveCurrentSceneIfUserWantsTo()) return;
            }

            string currentScene = null;
            int undoGroup = -1;
            if (m_Settings.runTestOnANewScene)
                currentScene = OpenNewScene();
            else
                undoGroup = RegisterUndo();

            StartTestRun(filter, new TestRunnerEventListener(UpdateTestInfo));

            if (m_Settings.runTestOnANewScene)
                LoadPreviousScene(currentScene);
            else
                PerformUndo(undoGroup);
        }
Ejemplo n.º 6
0
 public void StartTestRun(TestFilter filter, ITestRunnerCallback eventListener)
 {
     var callbackList = new TestRunnerCallbackList();
     if (eventListener != null) callbackList.Add(eventListener);
     k_TestEngine.RunTests(filter, callbackList);
 }
Ejemplo n.º 7
0
        private void ExecuteTestSuite(TestSuite suite, ITestRunnerCallback testRunnerEventListener, TestFilter filter)
        {
            EventListener eventListener;

            if (testRunnerEventListener == null)
            {
                eventListener = new NullListener();
            }
            else
            {
                eventListener = new TestRunnerEventListener(testRunnerEventListener);
            }
            suite.Run(eventListener, GetFilter(filter));
        }
Ejemplo n.º 8
0
        private void RunTests(TestFilter filter)
        {
            string currentScene = null;
            int    undoGroup    = -1;

            for (int i = 0; i < 3; ++i)
            {
                //if (runTestOnANewScene)
                //{
                //if (autoSaveSceneBeforeRun)
                //	EditorApplication.SaveScene ();

                //if (!EditorApplication.SaveCurrentSceneIfUserWantsTo ())
                //	return;
                //}
                failedTestCount = 0;
                if (runTestOnANewScene)
                {
                    currentScene = OpenNewScene();
                }
                else
                {
                    undoGroup = RegisterUndo();
                }

                string strInfo = "";
                if (testXmlFormat && i == 0)
                {
                    GameObject obj = new GameObject();
                    obj.name = "@UnitTest_0";
                    strInfo  = "Xml";
                }
                else if (testBsonFormat && i == 1)
                {
                    GameObject obj = new GameObject();
                    obj.name = "@UnitTest_1";
                    strInfo  = "Bson";
                }
                else if (testCSharpFormat && i == 2)
                {
                    GameObject obj = new GameObject();
                    obj.name = "@UnitTest_2";
                    strInfo  = "CSharp";
                }
                else
                {
                    continue;
                }

                StartTestRun(filter, new TestRunnerEventListener(UpdateTestInfo));

                if (failedTestCount > 0)
                {
                    Debug.LogError(strInfo + " Format test failed!");
                    break;
                }
            }

            if (runTestOnANewScene)
            {
                LoadPreviousScene(currentScene);
            }
            else
            {
                PerformUndo(undoGroup);
            }
        }