RunTests() public méthode

public RunTests ( IEnumerable allTestCases, IEnumerable testCasesToRun, string baseDir, string workingDir, string userParameters, bool isBeingDebugged, IDebuggedProcessLauncher debuggedLauncher ) : void
allTestCases IEnumerable
testCasesToRun IEnumerable
baseDir string
workingDir string
userParameters string
isBeingDebugged bool
debuggedLauncher IDebuggedProcessLauncher
Résultat void
        private void RunTests(IEnumerable <TestCase> testCasesToRun, List <Thread> threads, bool isBeingDebugged, IDebuggedProcessLauncher debuggedLauncher, IProcessExecutor executor)
        {
            TestCase[] testCasesToRunAsArray = testCasesToRun as TestCase[] ?? testCasesToRun.ToArray();

            ITestsSplitter          splitter = GetTestsSplitter(testCasesToRunAsArray);
            List <List <TestCase> > splittedTestCasesToRun = splitter.SplitTestcases();

            _logger.LogInfo("Executing tests on " + splittedTestCasesToRun.Count + " threads");
            _logger.DebugInfo("Note that no test output will be shown on the test console when executing tests concurrently!");

            int threadId = 0;

            foreach (List <TestCase> testcases in splittedTestCasesToRun)
            {
                var runner = new PreparingTestRunner(threadId++, _frameworkReporter, _logger, _settings.Clone(), _schedulingAnalyzer);
                _testRunners.Add(runner);

                var thread = new Thread(
                    () => runner.RunTests(testcases, isBeingDebugged, debuggedLauncher, executor))
                {
                    Name = $"GTA Testrunner {threadId}"
                };
                threads.Add(thread);

                thread.Start();
            }
        }
Exemple #2
0
        private void RunTests(IEnumerable <TestCase> testCasesToRun, List <Thread> threads, bool isBeingDebugged, IDebuggedProcessExecutorFactory processExecutorFactory)
        {
            TestCase[] testCasesToRunAsArray = testCasesToRun as TestCase[] ?? testCasesToRun.ToArray();

            ITestsSplitter          splitter = GetTestsSplitter(testCasesToRunAsArray);
            List <List <TestCase> > splittedTestCasesToRun = splitter.SplitTestcases();

            _logger.LogInfo(string.Format(Resources.ThreadExecutionMessage, splittedTestCasesToRun.Count));
            _logger.DebugInfo(Resources.NoTestOutputShown);

            int threadId = 0;

            foreach (List <TestCase> testcases in splittedTestCasesToRun)
            {
                var runner = new PreparingTestRunner(threadId++, _frameworkReporter, _logger, _settings.Clone(), _schedulingAnalyzer);
                _testRunners.Add(runner);

                var thread = new Thread(
                    () => runner.RunTests(testcases, isBeingDebugged, processExecutorFactory))
                {
                    Name = $"GTA Testrunner {threadId}"
                };
                threads.Add(thread);

                thread.Start();
            }
        }
        private void RunTests(IEnumerable<TestCase> allTestCases, IEnumerable<TestCase> testCasesToRun, string baseDir, List<Thread> threads, bool isBeingDebugged, IDebuggedProcessLauncher debuggedLauncher)
        {
            TestCase[] testCasesToRunAsArray = testCasesToRun as TestCase[] ?? testCasesToRun.ToArray();

            ITestsSplitter splitter = GetTestsSplitter(testCasesToRunAsArray);
            List<List<TestCase>> splittedTestCasesToRun = splitter.SplitTestcases();

            _testEnvironment.LogInfo("Executing tests on " + splittedTestCasesToRun.Count + " threads");
            _testEnvironment.DebugInfo("Note that no test output will be shown on the test console when executing tests concurrently!");

            int threadId = 0;
            foreach (List<TestCase> testcases in splittedTestCasesToRun)
            {
                var runner = new PreparingTestRunner(threadId++, _solutionDirectory, _frameworkReporter, _testEnvironment);
                _testRunners.Add(runner);

                var thread = new Thread(() => runner.RunTests(allTestCases, testcases, baseDir, null, null, isBeingDebugged, debuggedLauncher));
                threads.Add(thread);

                thread.Start();
            }
        }
        private void RunTests(IEnumerable <TestCase> allTestCases, IEnumerable <TestCase> testCasesToRun, string baseDir, List <Thread> threads, bool isBeingDebugged, IDebuggedProcessLauncher debuggedLauncher)
        {
            TestCase[] testCasesToRunAsArray = testCasesToRun as TestCase[] ?? testCasesToRun.ToArray();

            ITestsSplitter          splitter = GetTestsSplitter(testCasesToRunAsArray);
            List <List <TestCase> > splittedTestCasesToRun = splitter.SplitTestcases();

            TestEnvironment.LogInfo("Executing tests on " + splittedTestCasesToRun.Count + " threads");
            TestEnvironment.DebugInfo("Note that no test output will be shown on the test console when executing tests concurrently!");

            int threadId = 0;

            foreach (List <TestCase> testcases in splittedTestCasesToRun)
            {
                ITestRunner runner = new PreparingTestRunner(threadId++, SolutionDirectory, FrameworkReporter, TestEnvironment);
                TestRunners.Add(runner);

                Thread thread = new Thread(() => runner.RunTests(allTestCases, testcases, baseDir, null, isBeingDebugged, debuggedLauncher));
                threads.Add(thread);

                thread.Start();
            }
        }