protected void Debug(string method, string function) { #if DEBUG var msg = string.Format("{0} {1} {2} is {3}", Name, adapterVersion, method, function); TestLog.SendDebugMessage(msg); #endif }
public void RunAssembly(IFrameworkHandle testLog) { try { #if LAUNCHDEBUGGER System.Diagnostics.Debugger.Launch(); #endif if (TryLoadAssembly()) { var listener = new NUnitEventListener(testLog, TestConverter); try { runner.Run(listener, NUnitFilter, true, LoggingThreshold.Off); } catch (NullReferenceException) { // this happens during the run when CancelRun is called. logger.SendDebugMessage("Nullref caught"); } finally { runner.Unload(); } } else { logger.NUnitLoadError(assemblyName); } } catch (BadImageFormatException) { // we skip the native c++ binaries that we don't support. logger.AssemblyNotSupportedWarning(assemblyName); } catch (System.IO.FileNotFoundException ex) { // Probably from the GetExportedTypes in NUnit.core, attempting to find an assembly, not a problem if it is not NUnit here logger.DependentAssemblyNotFoundWarning(ex.FileName, assemblyName); } catch (Exception ex) { logger.SendErrorMessage("Exception thrown executing tests in " + assemblyName, ex); } }