private bool WantOutputType(TestOutputType type) { TextDisplayContent mask = TextDisplayContent.Empty; switch (type) { case TestOutputType.Out: mask = TextDisplayContent.Out; break; case TestOutputType.Error: mask = TextDisplayContent.Error; break; case TestOutputType.Trace: mask = TextDisplayContent.Trace; break; case TestOutputType.Log: mask = TextDisplayContent.Log; break; } return(((int)mask & (int)this.content) != 0); }
public void TestOutput(RemoteTask task, string text, TestOutputType outputType) { try { broker.TestOutput(task, text, outputType).Wait(); } catch (Exception ex) { logger.Error(ex); } }
/////////////////////////////////////////////////////////////////////// public static bool HasFlags( TestOutputType flags, TestOutputType hasFlags, bool all ) { if (all) { return((flags & hasFlags) == hasFlags); } else { return((flags & hasFlags) != TestOutputType.None); } }
// TODO: We determine whether to include output // based solely on the output type. This works // well for everything but logging. Because we // are unable - at this stage of processing - // to determine the logging level of the output // all tabs displaying log output will show // output at the most verbose level specified // on any of the tabs. Since it's not likely // that anyone will display logging on multiple // tabs, this is not seen as a serious issue. // It may be resolved in a future release by // limiting the options available when specifying // the content of the output displayed. private bool ShouldInclude(TestOutputType type) { switch (type) { default: case TestOutputType.Out: return(content.Out); case TestOutputType.Error: return(content.Error); case TestOutputType.Log: return(true); // content.LogLevel != LoggingThreshold.Off; case TestOutputType.Trace: return(content.Trace); } }
/////////////////////////////////////////////////////////////////////// private /* protected virtual */ void Dispose( bool disposing ) { TraceOps.DebugTrace(String.Format( "Dispose: disposing = {0}, interpreter = {1}, disposed = {2}", disposing, FormatOps.InterpreterNoThrow(interpreter), disposed), typeof(TestContext).Name, TracePriority.CleanupDebug); if (!disposed) { if (disposing) { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// interpreter = null; /* NOT OWNED: Do not dispose. */ threadId = 0; /////////////////////////////////////////////////////////// targetInterpreter = null; /* NOT OWNED: Do not dispose. */ /////////////////////////////////////////////////////////// statistics = null; /////////////////////////////////////////////////////////// if (constraints != null) { constraints.Clear(); constraints = null; } /////////////////////////////////////////////////////////// if (failures != null) { failures.Clear(); failures = null; } /////////////////////////////////////////////////////////// if (counts != null) { counts.Clear(); counts = null; } /////////////////////////////////////////////////////////// if (match != null) { match.Clear(); match = null; } /////////////////////////////////////////////////////////// if (skip != null) { skip.Clear(); skip = null; } /////////////////////////////////////////////////////////// if (returnCodeMessages != null) { returnCodeMessages.Clear(); returnCodeMessages = null; } /////////////////////////////////////////////////////////// #if DEBUGGER if (breakpoints != null) { breakpoints.Clear(); breakpoints = null; } #endif /////////////////////////////////////////////////////////// path = null; verbose = TestOutputType.None; repeatCount = 0; } ////////////////////////////////////// // release unmanaged resources here... ////////////////////////////////////// disposed = true; } }
public BufferedEventListenerTextWriter(EventListener eventListener, TestOutputType type) { this.eventListener = eventListener; this.type = type; }
/// <summary> /// Construct with text and an ouput destination type /// </summary> /// <param name="text">Text to be output</param> /// <param name="type">Destination of output</param> public TestOutput(string text, TestOutputType type) { this.text = text; this.type = type; }
private bool WantOutputType( TestOutputType type ) { TextDisplayContent mask = TextDisplayContent.Empty; switch( type ) { case TestOutputType.Out: mask = TextDisplayContent.Out; break; case TestOutputType.Error: mask = TextDisplayContent.Error; break; case TestOutputType.Trace: mask = TextDisplayContent.Trace; break; case TestOutputType.Log: mask = TextDisplayContent.Log; break; } return ((int)mask & (int)this.content) != 0; }
/// <summary> /// Initializes a new instance of the <see cref="EventListenerTextWriter"/> class. /// </summary> /// <param name="eventListener">The event listener.</param> /// <param name="type">The type.</param> public EventListenerTextWriter( ITestListener eventListener, TestOutputType type ) { this.eventListener = eventListener; this.type = type; this.buffer = new StringBuilder(); }
public TextCapture(ITestListener listener, TestOutputType outputType) { _listener = listener; _outputType = outputType; }
/// <summary> /// Initializes a new instance of the <see cref="EventListenerTextWriter"/> class. /// </summary> /// <param name="eventListener">The event listener.</param> /// <param name="type">The type.</param> public EventListenerTextWriter(ITestListener eventListener, TestOutputType type) { this.eventListener = eventListener; this.type = type; this.buffer = new StringBuilder(); }
public BufferedEventListenerTextWriter(ITestListener listener, TestOutputType type) { this.listener = listener; this.type = type; }
/// <summary> /// Construct with text and an output destination type /// </summary> /// <param name="text">Text to be output</param> /// <param name="type">Destination of output</param> public TestOutput(string text, TestOutputType type) { Text = text; Type = type; }
// TODO: We determine whether to include output // based solely on the output type. This works // well for everything but logging. Because we // are unable - at this stage of processing - // to determine the logging level of the output // all tabs displaying log output will show // output at the most verbose level specified // on any of the tabs. Since it's not likely // that anyone will display logging on multiple // tabs, this is not seen as a serious issue. // It may be resolved in a future release by // limiting the options available when specifying // the content of the output displayed. private bool ShouldInclude(TestOutputType type) { switch (type) { default: case TestOutputType.Out: return content.Out; case TestOutputType.Error: return content.Error; case TestOutputType.Log: return true;// content.LogLevel != LoggingThreshold.Off; case TestOutputType.Trace: return content.Trace; } }
public BufferedEventListenerTextWriter( EventListener eventListener, TestOutputType type ) { this.eventListener = eventListener; this.type = type; }
public BufferedEventListenerTextWriter( ITestListener listener, TestOutputType type ) { this.listener = listener; this.type = type; }