I haven't tried the code, but it doesn't look like it should work. The Sleep
command will put the thread that sends events into a wait state. However,
that won't have any impact on the test thread. I think it will just continue
to run tests and queue events that you never see because of the Sleep.
Charlie
On Tue, Jul 12, 2011 at 3:20 PM, Nicolas Rivera
<email address hidden> wrote:
> For anyone interested, I think I found a workaround. The following
> adding seems to do the trick:
>
> [NUnitAddin(Description = "Stop Upon Failure")]
> public class StopUponFailureAddIn : IAddin, EventListener
> {
> #region IAddin Members
>
> public bool Install(IExtensionHost host)
> {
> if (host == null)
> throw new ArgumentNullException("host");
>
> IExtensionPoint listeners = host.GetExtensionPoint("EventListeners");
> if (listeners == null)
> return false;
>
> listeners.Install(this);
> return true;
> }
>
> #endregion
>
> #region EventListener Members
>
> public void RunFinished(Exception exception)
> {
> }
>
> public void RunFinished(TestResult result)
> {
> }
>
> public void RunStarted(string name, int testCount)
> {
> }
>
> public void SuiteFinished(TestResult result)
> {
> }
>
> public void SuiteStarted(TestName testName)
> {
> }
>
> public void TestFinished(TestResult result)
> {
> if (result.IsError || result.IsFailure)
> {
> Trace.WriteLine("STOPPING TEST EXECUTION");
> Thread.Sleep(Timeout.Infinite);
> }
> }
>
> public void TestOutput(TestOutput testOutput)
> {
> }
>
> public void TestStarted(TestName testName)
> {
> }
>
> public void UnhandledException(Exception exception)
> {
> }
>
> #endregion
> }
>
> --
> You received this bug notification because you are subscribed to NUnit
> Framework.
> https://bugs.launchpad.net/bugs/730891
>
> Title:
> GUI runner option to stop upon failure
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nunit-3.0/+bug/730891/+subscriptions
>
I haven't tried the code, but it doesn't look like it should work. The Sleep
command will put the thread that sends events into a wait state. However,
that won't have any impact on the test thread. I think it will just continue
to run tests and queue events that you never see because of the Sleep.
Charlie
On Tue, Jul 12, 2011 at 3:20 PM, Nicolas Rivera Description = "Stop Upon Failure")] AddIn : IAddin, EventListener IExtensionHost host) eption( "host") ; onPoint( "EventListeners "); Install( this); Exception exception) TestResult result) TestResult result) TestName testName) TestResult result) ("STOPPING TEST EXECUTION"); Sleep(Timeout. Infinite) ; TestOutput testOutput) TestName testName) ion(Exception exception) /bugs.launchpad .net/bugs/ 730891 /bugs.launchpad .net/nunit- 3.0/+bug/ 730891/ +subscriptions
<email address hidden> wrote:
> For anyone interested, I think I found a workaround. The following
> adding seems to do the trick:
>
> [NUnitAddin(
> public class StopUponFailure
> {
> #region IAddin Members
>
> public bool Install(
> {
> if (host == null)
> throw new ArgumentNullExc
>
> IExtensionPoint listeners = host.GetExtensi
> if (listeners == null)
> return false;
>
> listeners.
> return true;
> }
>
> #endregion
>
> #region EventListener Members
>
> public void RunFinished(
> {
> }
>
> public void RunFinished(
> {
> }
>
> public void RunStarted(string name, int testCount)
> {
> }
>
> public void SuiteFinished(
> {
> }
>
> public void SuiteStarted(
> {
> }
>
> public void TestFinished(
> {
> if (result.IsError || result.IsFailure)
> {
> Trace.WriteLine
> Thread.
> }
> }
>
> public void TestOutput(
> {
> }
>
> public void TestStarted(
> {
> }
>
> public void UnhandledExcept
> {
> }
>
> #endregion
> }
>
> --
> You received this bug notification because you are subscribed to NUnit
> Framework.
> https:/
>
> Title:
> GUI runner option to stop upon failure
>
> To manage notifications about this bug go to:
> https:/
>