/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { log.Info("Loading " + TestPackage.Name); Unload(); try { if (_agent == null) { _agent = _agency.GetAgent(TestPackage, 30000); if (_agent == null) { throw new Exception("Unable to acquire remote process agent"); } } if (_remoteRunner == null) { _remoteRunner = _agent.CreateRunner(TestPackage); } return(_remoteRunner.Load()); } catch (Exception) { // TODO: Check if this is really needed // Clean up if the load failed Unload(); throw; } }
/// <summary> /// Load a TestPackage for possible execution. The /// explicit implementation returns an ITestEngineResult /// for consumption by clients. /// </summary> /// <returns>An XmlNode representing the loaded assembly.</returns> public XmlNode Load() { LoadResult = PrepareResult(_engineRunner.Load()) .Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName); return(LoadResult.Xml); }
public TestEngineResult Load() { //System.Diagnostics.Debug.Assert(false, "Attach debugger if desired"); _runner = Services.GetService <ITestRunnerFactory>().MakeTestRunner(_package); return(_runner.Load()); }
public TestEngineResult Load(TestPackage package) { //System.Diagnostics.Debug.Assert(false, "Attach debugger if desired"); this.runner = Services.TestRunnerFactory.MakeTestRunner(package); return(runner.Load(package)); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { // Last chance to catch invalid settings in package, // in case the client runner missed them. ValidatePackageSettings(); // Some files in the top level package may be projects. // Expand them so that they contain subprojects for // each contained assembly. ExpandProjects(); // Use SelectRuntimeFramework for its side effects. // Info will be left behind in the package about // each contained assembly, which will subsequently // be used to determine how to run the assembly. _runtimeService.SelectRuntimeFramework(TestPackage); if (IntPtr.Size == 8 && TestPackage.GetSetting(PackageSettings.ProcessModel, "") == "InProcess" && TestPackage.GetSetting(PackageSettings.RunAsX86, false)) { throw new NUnitEngineException("Cannot run tests in process - a 32 bit process is required."); } _realRunner = TestRunnerFactory.MakeTestRunner(TestPackage); return(_realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName)); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { // Temporarily using AggregatingTestRunner for everything //_realRunner = new AggregatingTestRunner(Services, TestPackage); _realRunner = Services.TestRunnerFactory.MakeTestRunner(TestPackage); return(_realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName)); }
private void CommandLoop() { bool keepRunning = true; var socketReader = new SocketReader(_clientSocket, new BinarySerializationProtocol()); while (keepRunning) { var command = socketReader.GetNextMessage <CommandMessage>(); switch (command.CommandName) { case "CreateRunner": var package = (TestPackage)command.Arguments[0]; _runner = CreateRunner(package); break; case "Load": SendResult(_runner.Load()); break; case "Reload": SendResult(_runner.Reload()); break; case "Unload": _runner.Unload(); break; case "Explore": var filter = (TestFilter)command.Arguments[0]; SendResult(_runner.Explore(filter)); break; case "CountTestCases": filter = (TestFilter)command.Arguments[0]; SendResult(_runner.CountTestCases(filter)); break; case "Run": filter = (TestFilter)command.Arguments[0]; SendResult(_runner.Run(this, filter)); break; case "RunAsync": filter = (TestFilter)command.Arguments[0]; _runner.RunAsync(this, filter); break; case "Stop": keepRunning = false; break; } } Stop(); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { // Last chance to catch invalid settings in package, // in case the client runner missed them. ValidatePackageSettings(); _realRunner = TestRunnerFactory.MakeTestRunner(TestPackage); return _realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { // Last chance to catch invalid settings in package, // in case the client runner missed them. ValidatePackageSettings(); _realRunner = TestRunnerFactory.MakeTestRunner(TestPackage); return(_realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName)); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { log.Info("Loading " + TestPackage.Name); Unload(); try { CreateAgentAndRunner(); return(_remoteRunner.Load()); } catch (Exception) { // TODO: Check if this is really needed // Clean up if the load failed Unload(); throw; } }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { // Last chance to catch invalid settings in package, // in case the client runner missed them. ValidatePackageSettings(); // Some files in the top level package may be projects. // Expand them so that they contain subprojects for // each contained assembly. ExpandProjects(); // Use SelectRuntimeFramework for its side effects. // Info will be left behind in the package about // each contained assembly, which will subsequently // be used to determine how to run the assembly. RuntimeService.SelectRuntimeFramework(TestPackage); _realRunner = TestRunnerFactory.MakeTestRunner(TestPackage); return(_realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName)); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { log.Info("Loading " + TestPackage.Name); Unload(); string frameworkSetting = TestPackage.GetSetting(RunnerSettings.RuntimeFramework, ""); RuntimeFramework = frameworkSetting != "" ? RuntimeFramework.Parse(frameworkSetting) : Services.RuntimeFrameworkSelector.SelectRuntimeFramework(TestPackage); bool useX86Agent = TestPackage.GetSetting(RunnerSettings.RunAsX86, false); bool enableDebug = TestPackage.GetSetting("AgentDebug", false); bool verbose = TestPackage.GetSetting("Verbose", false); string agentArgs = string.Empty; if (enableDebug) { agentArgs += " --pause"; } if (verbose) { agentArgs += " --verbose"; } try { CreateAgentAndRunner(enableDebug, agentArgs, useX86Agent); return(_remoteRunner.Load()); } catch (Exception) { // TODO: Check if this is really needed // Clean up if the load failed Unload(); throw; } }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { log.Info("Loading " + TestPackage.Name); Unload(); try { if (_agent == null) { // Increase the timeout to give time to attach a debugger bool debug = TestPackage.GetSetting(EnginePackageSettings.DebugAgent, false) || TestPackage.GetSetting(EnginePackageSettings.PauseBeforeRun, false); _agent = _agency.GetAgent(TestPackage, debug ? DEBUG_TIMEOUT : NORMAL_TIMEOUT); if (_agent == null) { throw new Exception("Unable to acquire remote process agent"); } } if (_remoteRunner == null) { _remoteRunner = _agent.CreateRunner(TestPackage); } return(_remoteRunner.Load()); } catch (Exception) { // TODO: Check if this is really needed // Clean up if the load failed Unload(); throw; } }
/// <summary> /// Load a TestPackage for possible execution. The /// explicit implementation returns an ITestEngineResult /// for consumption by clients. /// </summary> /// <returns>An XmlNode representing the loaded assembly.</returns> public XmlNode Load() { LoadResult = _engineRunner.Load(); return(LoadResult.Xml); }
public TestEngineResult Load() { //System.Diagnostics.Debug.Assert(false, "Attach debugger if desired"); _runner = Services.GetService<ITestRunnerFactory>().MakeTestRunner(_package); return _runner.Load(); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <param name="package">The TestPackage to be loaded</param> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { PerformPackageSetup(TestPackage); return(_realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName)); }
public TestEngineResult Load() { return(_runner.Load()); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { // Last chance to catch invalid settings in package, // in case the client runner missed them. ValidatePackageSettings(); // Some files in the top level package may be projects. // Expand them so that they contain subprojects for // each contained assembly. ExpandProjects(); // Use SelectRuntimeFramework for its side effects. // Info will be left behind in the package about // each contained assembly, which will subsequently // be used to determine how to run the assembly. RuntimeService.SelectRuntimeFramework(TestPackage); _realRunner = TestRunnerFactory.MakeTestRunner(TestPackage); return _realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName); }
/// <summary> /// Load a TestPackage for possible execution. The /// explicit implementation returns an ITestEngineResult /// for consumption by clients. /// </summary> /// <returns>An XmlNode representing the loaded assembly.</returns> public XmlNode Load() { LoadResult = PrepareResult(_engineRunner.Load()).MakeTestRunResult(TestPackage); return(LoadResult.Xml); }
/// <summary> /// Load a TestPackage for possible execution /// </summary> /// <returns>A TestEngineResult.</returns> protected override TestEngineResult LoadPackage() { // Last chance to catch invalid settings in package, // in case the client runner missed them. ValidatePackageSettings(); // Some files in the top level package may be projects. // Expand them so that they contain subprojects for // each contained assembly. ExpandProjects(); // Use SelectRuntimeFramework for its side effects. // Info will be left behind in the package about // each contained assembly, which will subsequently // be used to determine how to run the assembly. _runtimeService.SelectRuntimeFramework(TestPackage); if (TestPackage.GetSetting(PackageSettings.ProcessModel, "") == "InProcess" && TestPackage.GetSetting(PackageSettings.RunAsX86, false)) { throw new NUnitEngineException("Cannot run tests in process - a 32 bit process is required."); } _realRunner = TestRunnerFactory.MakeTestRunner(TestPackage); return _realRunner.Load().Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName); }