GoogleTestAdapter.TestAdapter.Framework.VsTestFrameworkReporter.AllTestsFinished C# (CSharp) Method

AllTestsFinished() private method

private AllTestsFinished ( ) : void
return void
        internal void AllTestsFinished()
        {
            // This is part of a workaround for a Visual Studio bug. See above.
            bool done = false;
            ThreadPool.QueueUserWorkItem(delegate { Thread.Sleep(SleepingTimeAfterAllTestsInMs); done = true; });
            while (!done)
                Thread.Sleep(200);
        }
    }

Usage Example

Ejemplo n.º 1
0
        private void DoRunTests(
            IEnumerable<TestCase> allTestCasesInExecutables, ICollection<TestCase> testCasesToRun,
            IRunContext runContext, IFrameworkHandle frameworkHandle, Stopwatch stopwatch)
        {
            bool isRunningInsideVisualStudio = !string.IsNullOrEmpty(runContext.SolutionDirectory);
            var reporter = new VsTestFrameworkReporter(frameworkHandle, isRunningInsideVisualStudio);
            var launcher = new DebuggedProcessLauncher(frameworkHandle);
            _executor = new GoogleTestExecutor(_testEnvironment);
            _executor.RunTests(allTestCasesInExecutables, testCasesToRun, reporter, launcher,
                runContext.IsBeingDebugged, runContext.SolutionDirectory);
            reporter.AllTestsFinished();

            stopwatch.Stop();
            _testEnvironment.LogInfo($"Google Test execution completed, overall duration: {stopwatch.Elapsed}.");
        }