public async Task <TestRunResult> ExecuteTests(IEnumerable <ITest> tests = null, bool force = false) { var resultPackage = new TestRunResult(); var filter = new CustomTestFilter(tests, force); var listener = Options?.LogToOutput == true ? new CustomTestListener() : TestListener.NULL; var result = await Task.Run(() => _runner.Run(listener, filter)).ConfigureAwait(false); LogTestRun(result); resultPackage.AddResult(result); resultPackage.CompleteTestRun(); return(resultPackage); }
public async Task <TestRunResult> ExecuteTests() { var resultPackage = new TestRunResult(); foreach (var assembly in _testAssemblies) { NUnitTestAssemblyRunner runner = await LoadTestAssemblyAsync(assembly).ConfigureAwait(false); ITestResult result = await Task.Run(() => runner.Run(TestListener.NULL, TestFilter.Empty)).ConfigureAwait(false); resultPackage.AddResult(result); } resultPackage.CompleteTestRun(); return(resultPackage); }