예제 #1
0
        private void StartNewTest()
        {
            m_TestMessages = "";
            m_Stacktrace   = "";
            m_TestState    = TestState.Running;

            m_StartTime = Time.time;
            currentTest = m_TestsProvider.GetNextTest() as TestComponent;

            var testResult = m_ResultList.Single(result => result.TestComponent == currentTest);

            if (currentTest != null && currentTest.IsExludedOnThisPlatform())
            {
                m_TestState = TestState.Ignored;
                Debug.Log(currentTest.gameObject.name + " is excluded on this platform");
            }

            // don't ignore test if user initiated it from the runner and it's the only test that is being run
            if (currentTest != null &&
                (currentTest.IsIgnored() &&
                 !(isInitializedByRunner && m_ResultList.Count == 1)))
            {
                m_TestState = TestState.Ignored;
            }

            LogMessage(k_StartedMessage);
            TestRunnerCallback.TestStarted(testResult);
        }
예제 #2
0
        private void StartNewTest()
        {
            this.testMessages = "";
            this.stacktrace   = "";
            testState         = TestState.Running;
            assertionsToCheck = null;

            startTime             = Time.time;
            currentTest           = testToRunQueue.Dequeue();
            currentTest.isRunning = true;
            currentTest.go.SetActive(true);

            if (currentTest.TestComponent.succeedAfterAllAssertionsAreExecuted)
            {
                assertionsToCheck = currentTest.go.GetComponentsInChildren <AssertionComponent>().Where(a => a.enabled).ToArray();
            }

            if (currentTest.TestComponent.IsExludedOnThisPlatform())
            {
                testState = TestState.Ignored;
                Debug.Log(currentTest.name + " is excluded on this platform");
            }

            //do not run ignored tests only when it's batch mode
            //test runner in the editor will not pass ignored tests to run, unless is expected to
            if (!isInitializedByRunner && currentTest.TestComponent.ignored)
            {
                testState = TestState.Ignored;
            }
            LogMessage(startedMessage);
            TestRunnerCallback.TestStarted(currentTest);
        }
예제 #3
0
        private void StartNewTest()
        {
            m_TestMessages      = "";
            m_Stacktrace        = "";
            m_TestState         = TestState.Running;
            m_AssertionsToCheck = null;

            m_StartTime = Time.time;
            currentTest = m_TestsProvider.GetNextTest() as TestComponent;

            var testResult = m_ResultList.Single(result => result.TestComponent == currentTest);

            if (currentTest != null && currentTest.ShouldSucceedOnAssertions())
            {
                var assertionList = currentTest.gameObject.GetComponentsInChildren <AssertionComponent>().Where(a => a.enabled);
                if (assertionList.Any())
                {
                    m_AssertionsToCheck = assertionList.ToArray();
                }
            }

            if (currentTest != null && currentTest.IsExludedOnThisPlatform())
            {
                m_TestState = TestState.Ignored;
                Debug.Log(currentTest.gameObject.name + " is excluded on this platform");
            }

            // don't ignore test if user initiated it from the runner and it's the only test that is being run
            if (currentTest != null &&
                (currentTest.IsIgnored() &&
                 !(isInitializedByRunner && m_ResultList.Count == 1)))
            {
                m_TestState = TestState.Ignored;
            }

            LogMessage(k_StartedMessage);
            TestRunnerCallback.TestStarted(testResult);
        }
예제 #4
0
        private void StartNewTest()
        {
            Debug.Log("StartNewTest");
            m_TestMessages = "";
            m_Stacktrace   = "";
            m_TestState    = TestState.Running;
            m_StartTime    = Time.time;
            currentTest    = m_TestsProvider.GetNextTest() as TestComponent;
            Debug.Log("GetNextTest: " + currentTest.name);
            TestResult test = m_ResultList.Single((TestResult result) => result.TestComponent == currentTest);

            if (currentTest != null && currentTest.IsExludedOnThisPlatform())
            {
                m_TestState = TestState.Ignored;
                Debug.Log(currentTest.gameObject.name + " is excluded on this platform");
            }
            if (currentTest != null && currentTest.IsIgnored() && (!isInitializedByRunner || m_ResultList.Count != 1))
            {
                m_TestState = TestState.Ignored;
            }
            LogMessage("IntegrationTest Started");
            TestRunnerCallback.TestStarted(test);
        }
예제 #5
0
        private void StartNewTest()
        {
            this.testMessages = "";
            this.stacktrace   = "";
            testState         = TestState.Running;
            assertionsToCheck = null;

            startTime   = Time.time;
            currentTest = testsProvider.GetNextTest();
            var testResult = testToRun.Single(result => result.TestComponent == currentTest);

            testResult.isRunning = true;

            if (currentTest.ShouldSucceedOnAssertions())
            {
                var assertionList = currentTest.gameObject.GetComponentsInChildren <AssertionComponent> ().Where(a => a.enabled);
                if (assertionList.Any())
                {
                    assertionsToCheck = assertionList.ToArray();
                }
            }

            if (currentTest.IsExludedOnThisPlatform())
            {
                testState = TestState.Ignored;
                Debug.Log(currentTest.gameObject.name + " is excluded on this platform");
            }

            //do not run ignored tests only when it's batch mode
            //test runner in the editor will not pass ignored tests to run, unless is expected to
            if (!isInitializedByRunner && currentTest.IsIgnored())
            {
                testState = TestState.Ignored;
            }
            LogMessage(startedMessage);
            TestRunnerCallback.TestStarted(testResult);
        }