GetLocalTestResult() public method

public GetLocalTestResult ( NUnit.Core.TestResult t ) : RemoteTestResult
t NUnit.Core.TestResult
return RemoteTestResult
		public RemoteTestResult Run (string[] nameFilter, string path, string suiteName, string[] supportAssemblies, string testRunnerType, string testRunnerAssembly, string crashLogFile)
		{
			NUnitTestRunner runner = GetRunner (path);
			EventListenerWrapper listenerWrapper = new EventListenerWrapper (server);
			
			UnhandledExceptionEventHandler exceptionHandler = (object sender, UnhandledExceptionEventArgs e) => {
				var ex = e.ExceptionObject;
				File.WriteAllText (crashLogFile, e.ToString ());
			};

			AppDomain.CurrentDomain.UnhandledException += exceptionHandler;
			try {
				TestResult res = runner.Run (listenerWrapper, nameFilter, path, suiteName, supportAssemblies, testRunnerType, testRunnerAssembly);
				return listenerWrapper.GetLocalTestResult (res);
			} finally {
				AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;
			}
		}
Beispiel #2
0
        public RemoteTestResult Run(string[] nameFilter, string path, string suiteName, string[] supportAssemblies, string testRunnerType, string testRunnerAssembly, string crashLogFile)
        {
            NUnitTestRunner      runner          = GetRunner(path);
            EventListenerWrapper listenerWrapper = new EventListenerWrapper(server);

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

            AppDomain.CurrentDomain.UnhandledException += exceptionHandler;
            try {
                TestResult res = runner.Run(listenerWrapper, nameFilter, path, suiteName, supportAssemblies, testRunnerType, testRunnerAssembly);
                return(listenerWrapper.GetLocalTestResult(res));
            } finally {
                AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;
            }
        }