Ejemplo n.º 1
0
        private void FinishTest(TestResult.ResultType result)
        {
            m_TestsProvider.FinishTest(currentTest);
            var testResult = m_ResultList.Single(t => t.GameObject == currentTest.gameObject);

            testResult.resultType = result;
            testResult.duration   = Time.time - m_StartTime;
            testResult.messages   = m_TestMessages;
            testResult.stacktrace = m_Stacktrace;
            TestRunnerCallback.TestFinished(testResult);
            currentTest = null;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
            var loadedLevelName = Application.loadedLevelName;
#else
            var loadedLevelName = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene().name;
#endif

            if (!testResult.IsSuccess &&
                testResult.Executed &&
                !testResult.IsIgnored)
            {
                k_ResultRenderer.AddResults(loadedLevelName, testResult);
            }
        }
Ejemplo n.º 2
0
        private void FinishTest(TestResult.ResultType result)
        {
            Debug.Log("FinishTest");
            m_TestsProvider.FinishTest(currentTest);
            TestResult testResult = m_ResultList.Single((TestResult t) => t.GameObject == currentTest.gameObject);

            testResult.resultType = result;
            testResult.duration   = (double)Time.time - m_StartTime;
            testResult.messages   = m_TestMessages;
            testResult.stacktrace = m_Stacktrace;
            TestRunnerCallback.TestFinished(testResult);
            currentTest = null;
            if (!testResult.IsSuccess && testResult.Executed && !testResult.IsIgnored)
            {
                k_ResultRenderer.AddResults(SceneManager.GetActiveScene().name, testResult);
            }
        }
Ejemplo n.º 3
0
        private void FinishTest(TestResult.ResultType result)
        {
            m_TestsProvider.FinishTest(currentTest);
            var testResult = m_ResultList.Single(t => t.GameObject == currentTest.gameObject);

            testResult.resultType = result;
            testResult.duration   = Time.time - m_StartTime;
            testResult.messages   = m_TestMessages;
            testResult.stacktrace = m_Stacktrace;
            TestRunnerCallback.TestFinished(testResult);
            currentTest = null;
            if (!testResult.IsSuccess &&
                testResult.Executed &&
                !testResult.IsIgnored)
            {
                k_ResultRenderer.AddResults(Application.loadedLevelName, testResult);
            }
        }
Ejemplo n.º 4
0
        private void FinishTest(TestResult.ResultType result)
        {
            FindObjectOfType <PlayerController> ().PlayerReset();
            m_TestsProvider.FinishTest(currentTest);
            var testResult = m_ResultList.Single(t => t.GameObject == currentTest.gameObject);

            testResult.resultType = result;
            testResult.duration   = Time.time - m_StartTime;
            testResult.messages   = m_TestMessages;
            testResult.stacktrace = m_Stacktrace;
            TestRunnerCallback.TestFinished(testResult);
            currentTest = null;
            if (!testResult.IsSuccess &&
                testResult.Executed &&
                !testResult.IsIgnored)
            {
                k_ResultRenderer.AddResults(SceneManager.GetActiveScene().name, testResult);
            }
        }
Ejemplo n.º 5
0
        private void FinishTest(TestResult.ResultType result)
        {
            testsProvider.FinishTest(currentTest);
            var testResult = testToRun.Single(t => t.isRunning);

            testResult.resultType = result;
            testResult.isRunning  = false;
            testResult.duration   = Time.time - startTime;
            testResult.messages   = testMessages;
            testResult.stacktrace = stacktrace;
            TestRunnerCallback.TestFinished(testResult);
            currentTest = null;
            if (!testResult.IsSuccess &&
                testResult.Executed &&
                !testResult.IsIgnored)
            {
                resultRenderer.AddResults(Application.loadedLevelName, testResult);
            }
        }
Ejemplo n.º 6
0
        private void FinishTest(TestResult.ResultType result)
        {
            // Hot-swap can cause the test provider to be lost
            if (m_TestsProvider != null)
            {
                m_TestsProvider.FinishTest(currentTest);
            }
            var testResult = m_ResultList.Single(t => t.GameObject == currentTest.gameObject);

            testResult.resultType = result;
            testResult.duration   = Time.time - m_StartTime;
            testResult.messages   = m_TestMessages;
            testResult.stacktrace = m_Stacktrace;
            TestRunnerCallback.TestFinished(testResult);
            currentTest = null;
            if (!testResult.IsSuccess &&
                testResult.Executed &&
                !testResult.IsIgnored)
            {
                k_ResultRenderer.AddResults(SceneManager.GetActiveScene().name, testResult);
            }
        }