Пример #1
0
        public ITestRunner Create(StrykerOptions options, ProjectInfo projectInfo)
        {
            _logger.LogDebug("Factory is creating testrunner for asked type {0}", options.TestRunner);
            ITestRunner testRunner = null;

            // TODO: Make vstest work for dotnet core on non-windows systems.
            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && options.TestRunner != TestRunner.DotnetTest)
            {
                _logger.LogWarning("Using testrunner {0} because OS is not windows. Stryker does not currently support vstest on non-windows OS.", TestRunner.DotnetTest.ToString());
                return(new DotnetTestRunner(projectInfo.TestProjectPath, new ProcessExecutor(), new TotalNumberOfTestsParser()));
            }

            switch (options.TestRunner)
            {
            case TestRunner.DotnetTest:
                testRunner = new DotnetTestRunner(projectInfo.TestProjectPath, new ProcessExecutor(), new TotalNumberOfTestsParser());
                break;

            case TestRunner.VsTest:
                testRunner = new VsTestRunnerPool(options, projectInfo);
                break;

            default:
                testRunner = new DotnetTestRunner(projectInfo.TestProjectPath, new ProcessExecutor(), new TotalNumberOfTestsParser());
                break;
            }
            _logger.LogInformation("Using testrunner {0}", options.TestRunner.ToString());
            return(testRunner);
        }
Пример #2
0
        public ITestRunner Create(IStrykerOptions options, OptimizationFlags flags, ProjectInfo projectInfo)
        {
            _logger.LogInformation("Initializing test runners ({0})", options.TestRunner);
            ITestRunner testRunner;

            switch (options.TestRunner)
            {
            case TestRunner.DotnetTest:
            default:
                testRunner = new DotnetTestRunner(projectInfo.ProjectUnderTestAnalyzerResult.ProjectFilePath, new ProcessExecutor(), flags, projectInfo.TestProjectAnalyzerResults.Select(x => x.GetAssemblyPath()));
                break;

            case TestRunner.VsTest:
                testRunner = new VsTestRunnerPool(options, flags, projectInfo);
                break;
            }
            return(testRunner);
        }
Пример #3
0
        public ITestRunner Create(string type, string path)
        {
            _logger.LogDebug("Factory is creating testrunner for asked type {0}", type);
            ITestRunner testRunner = null;

            switch (type)
            {
            case ("dotnet test"):
                testRunner = new DotnetTestRunner(path);
                break;

            default:
                testRunner = new DotnetTestRunner(path);
                break;
            }
            _logger.LogInformation("Using testrunner {0}", testRunner.GetType().Name);
            return(testRunner);
        }
Пример #4
0
        public ITestRunner Create(StrykerOptions options, OptimizationFlags flags, ProjectInfo projectInfo)
        {
            Logger.LogDebug("Factory is creating testrunner for asked type {0}", options.TestRunner);
            ITestRunner testRunner = null;

            switch (options.TestRunner)
            {
            case TestRunner.DotnetTest:
            default:
                testRunner = new DotnetTestRunner(options.BasePath, new ProcessExecutor(), new TotalNumberOfTestsParser(), flags);
                break;

            case TestRunner.VsTest:
                testRunner = new VsTestRunnerPool(options, flags, projectInfo);
                break;
            }
            Logger.LogInformation("Using testrunner {0}", options.TestRunner.ToString());
            return(testRunner);
        }
Пример #5
0
        public ITestRunner Create(StrykerOptions options, OptimizationFlags flags, ProjectInfo projectInfo)
        {
            _logger.LogDebug("Factory is creating testrunner for asked type {0}", options.TestRunner);
            ITestRunner testRunner;

            switch (options.TestRunner)
            {
            case TestRunner.DotnetTest:
            default:
                testRunner = new DotnetTestRunner(projectInfo.ProjectUnderTestAnalyzerResult.ProjectFilePath, new ProcessExecutor(), flags, projectInfo.TestProjectAnalyzerResults.Select(x => projectInfo.GetTestBinariesPath(x)));
                break;

            case TestRunner.VsTest:
                testRunner = new VsTestRunnerPool(options, flags, projectInfo);
                break;
            }
            _logger.LogInformation("Using testrunner {0}", options.TestRunner.ToString());
            return(testRunner);
        }