Exemplo n.º 1
0
        private async Task <TestSuiteResult> RunTestAsync(
            TestProject testProject,
            string dotNetPath,
            int maxTestTimeMin,
            string baselineDirectoryPath,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            Log.Info($"Starting to run tests in {testProject.Project.OutputFileName} ({testProject.Project.Name})");

            var testDllPath = _testRunnerDependencyFilesHandler.CreateTestDirectoryAndCopyDependencies(baselineDirectoryPath, testProject, baselineDirectoryPath);

            return(await _testRunnerClient.RunTestsAsync(testProject.TestRunner, testDllPath, dotNetPath, TimeSpan.FromMinutes(maxTestTimeMin), cancellationToken));
        }
        private async Task <TestSuiteResult> RunTestAsync(
            TestProject testProject,
            string mutationDirectoryPath,
            string mutationDllPath,
            string dotNetPath,
            TimeSpan testTimout)
        {
            LogTo.Info($"Starting to run tests in {testProject.Project.OutputFileName}");
            var mutationTestDirectoryPath = Path.Combine(mutationDirectoryPath, Guid.NewGuid().ToString());
            var testDllPath = Path.Combine(mutationTestDirectoryPath, testProject.Project.OutputFileName);

            Directory.CreateDirectory(mutationTestDirectoryPath);

            // Copy all files from the test directory to our own mutation test directory
            _testRunnerDependencyFilesHandler.CopyDependencies(testProject.Project.OutputDirectoryPath, mutationTestDirectoryPath);

            // Copy the mutation to our mutation test directory (and override the orginal file)
            File.Copy(mutationDllPath, Path.Combine(mutationTestDirectoryPath, Path.GetFileName(mutationDllPath)), true);

            return(await _testRunnerClient.RunTestsAsync(testProject.TestRunner, testDllPath, dotNetPath, testTimout));
        }
Exemplo n.º 3
0
        private async Task <TestSuiteResult> RunTestAsync(
            TestProject testProject,
            string dotNetPath,
            int maxTestTimeMin)
        {
            LogTo.Info($"Starting to run tests in {testProject.Project.OutputFileName}");
            var testDirectoryPath = Path.Combine(BaselineDirectoryPath, Guid.NewGuid().ToString());
            var testDllPath       = Path.Combine(testDirectoryPath, testProject.Project.OutputFileName);

            Directory.CreateDirectory(testDirectoryPath);

            // Copy all files from the test directory to our own mutation test directory
            _testRunnerDependencyFilesHandler.CopyDependencies(testProject.Project.OutputDirectoryPath, testDirectoryPath);

            foreach (var file in Directory.EnumerateFiles(BaselineDirectoryPath))
            {
                File.Copy(file, Path.Combine(testDirectoryPath, Path.GetFileName(file)), true);
            }

            return(await _testRunnerClient.RunTestsAsync(testProject.TestRunner, testDllPath, dotNetPath, TimeSpan.FromMinutes(maxTestTimeMin)));
        }