You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to VS Test Adapter documentation which describes a workaround to activate Trace and Debug output, @CharliePoole has hinted "possible to create a listener which would capture the output and send it as a Progress event or write it to stderr, but I don't believe such a thing exists at this time" which I implemented at TestCentric/testcentric-gui#1043 (comment). It is simple and works.
Same as the ConsoleTraceListener class is provided by the .NET Framework, I propose the NUnit framework provides this NUnit specific ProgressTraceListener ready for use by the NUnit users. I don't ask NUnit to always have this listener active, it shall only provide the class and document its purpose and how to use it.
The text was updated successfully, but these errors were encountered:
For completeness and those who would like to already use the resulting proposal, here's the code:
/// <summary>
/// Allows directing tracing or debugging output to <see cref="TestContext.Progress"/>.
/// </summary>
/// <remarks>
/// Implemented following the <see cref="ConsoleTraceListener"/> implementation.
/// </remarks>
[HostProtection(Synchronization = true)]
public class ProgressTraceListener : TextWriterTraceListener
{
/// <summary>
/// Initializes a new instance of the <see cref="ProgressTraceListener"/> class with trace
/// output written to <see cref="TestContext.Progress"/>.
/// </summary>
public ProgressTraceListener()
: base(TestContext.Progress)
{
}
}
To activate, place the following snippet into the one-time set-up method of either a test's fixture or the set-up fixture of a project:
This issue is based on discussions at TestCentric/testcentric-gui#1043 and nunit/nunit3-vs-adapter#718 but more belongs to NUnit itself.
Similar to VS Test Adapter documentation which describes a workaround to activate Trace and Debug output, @CharliePoole has hinted "possible to create a listener which would capture the output and send it as a Progress event or write it to stderr, but I don't believe such a thing exists at this time" which I implemented at TestCentric/testcentric-gui#1043 (comment). It is simple and works.
Same as the ConsoleTraceListener class is provided by the .NET Framework, I propose the NUnit framework provides this NUnit specific
ProgressTraceListener
ready for use by the NUnit users. I don't ask NUnit to always have this listener active, it shall only provide the class and document its purpose and how to use it.The text was updated successfully, but these errors were encountered: