public void RunFinished(ITestResultAdaptor testResults)
        {
            if (!Coverage.enabled)
            {
                return;
            }

            if (CoverageRunData.instance.isRecording || m_IsConnectedToPlayer)
            {
                return;
            }

            CoverageRunData.instance.Stop();

            if (!CoverageRunData.instance.DidTestsRun())
            {
                return;
            }

            ICoverageReporter coverageReporter = m_CoverageReporterManager.CoverageReporter;

            if (coverageReporter != null)
            {
                coverageReporter.OnRunFinished(testResults);
            }

            m_CoverageReporterManager.GenerateReport();
        }
Esempio n. 2
0
        internal static void StopRecordingInternal()
        {
            bool isRunning = CoverageRunData.instance.isRunning;

            if (isRunning)
            {
                if (CoverageRunData.instance.isRecording)
                {
                    if (CoverageRunData.instance.isRecordingPaused)
                    {
                        Coverage.ResetAll();
                    }

                    if (s_CoverageReporterManager == null)
                    {
                        s_CoverageReporterManager = CoverageReporterStarter.CoverageReporterManager;
                    }

                    ICoverageReporter coverageReporter = s_CoverageReporterManager.CoverageReporter;
                    if (coverageReporter != null)
                    {
                        coverageReporter.OnRunFinished(null);
                    }

                    CoverageRunData.instance.StopRecording();

                    s_CoverageReporterManager.GenerateReport();
                }
            }
        }