Inheritance: System.MarshalByRefObject, ITestEventListener
		public RunResponse Run (RunRequest r)
		{
			EventListenerWrapper listenerWrapper = new EventListenerWrapper (server);

			UnhandledExceptionEventHandler exceptionHandler = (object sender, UnhandledExceptionEventArgs e) => {
				var ex = e.ExceptionObject;
				File.WriteAllText (r.CrashLogFile, e.ToString ());
			};

			AppDomain.CurrentDomain.UnhandledException += exceptionHandler;
			try {
				var res = Run (listenerWrapper, r.NameFilter, r.Path, r.SuiteName, r.SupportAssemblies, r.TestRunnerType, r.TestRunnerAssembly);
				res = res.SelectSingleNode ("test-suite");
				return new RunResponse () { Result = listenerWrapper.GetLocalTestResult (res) };
			} finally {
				AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;
			}
		}
Esempio n. 2
0
        public RunResponse Run(RunRequest r)
        {
            EventListenerWrapper listenerWrapper = new EventListenerWrapper(server);

            UnhandledExceptionEventHandler exceptionHandler = (object sender, UnhandledExceptionEventArgs e) => {
                var ex = e.ExceptionObject;
                File.WriteAllText(r.CrashLogFile, e.ToString());
            };

            AppDomain.CurrentDomain.UnhandledException += exceptionHandler;
            try {
                var res = Run(listenerWrapper, r.NameFilter, r.Path, r.SuiteName, r.SupportAssemblies, r.TestRunnerType, r.TestRunnerAssembly);
                res = res.SelectSingleNode("test-suite");
                return(new RunResponse()
                {
                    Result = listenerWrapper.GetLocalTestResult(res)
                });
            } finally {
                AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;
            }
        }