/// <summary> /// Run the tests in the loaded TestPackage. /// </summary> /// <param name="listener">An ITestEventHandler to receive events</param> /// <param name="filter">A TestFilter used to select tests</param> /// <returns> /// A TestEngineResult giving the result of the test execution /// </returns> protected override TestEngineResult RunTests(ITestEventListener listener, TestFilter filter) { EnsurePackageIsLoaded(); var result = new TestEngineResult(); foreach (IFrameworkDriver driver in _drivers) { string driverResult; try { driverResult = driver.Run(listener, filter.Text); } catch (Exception ex) when(!(ex is NUnitEngineException)) { throw new NUnitEngineException("An exception occurred in the driver while running tests.", ex); } result.Add(driverResult); } #if !NETSTANDARD1_6 if (_assemblyResolver != null) { foreach (var package in TestPackage.AssemblyPackages()) { _assemblyResolver.RemovePathFromFile(package.FullName); } } #endif return(result); }
/// <summary> /// Run the tests in the loaded TestPackage. /// </summary> /// <param name="listener">An ITestEventHandler to receive events</param> /// <param name="filter">A TestFilter used to select tests</param> /// <returns> /// A TestEngineResult giving the result of the test execution /// </returns> protected override TestEngineResult RunTests(ITestEventListener listener, TestFilter filter) { var result = new TestEngineResult(); foreach (IFrameworkDriver driver in _drivers) { result.Add(driver.Run(listener, filter.Text)); } if (IsProjectPackage(TestPackage)) { result = result.MakePackageResult(TestPackage.Name, TestPackage.FullName); } var packages = TestPackage.SubPackages; if (packages.Count == 0) { packages.Add(TestPackage); } foreach (var package in packages) { _assemblyResolver.RemovePathFromFile(package.FullName); } return(result); }
/// <summary> /// Run the tests in the loaded TestPackage. /// </summary> /// <param name="listener">An ITestEventHandler to receive events</param> /// <param name="filter">A TestFilter used to select tests</param> /// <returns> /// A TestEngineResult giving the result of the test execution /// </returns> protected override TestEngineResult RunTests(ITestEventListener listener, TestFilter filter) { EnsurePackageIsLoaded(); string driverResult; try { driverResult = _driver.Run(listener, filter.Text); } catch (Exception ex) when(!(ex is NUnitEngineException)) { throw new NUnitEngineException("An exception occurred in the driver while running tests.", ex); } if (_assemblyResolver != null) { _assemblyResolver.RemovePathFromFile(TestPackage.FullName); } return(new TestEngineResult(driverResult)); }