From: <nan...@na...> - 2012-03-02 01:59:05
|
From: Ryan Boggs <rm...@gm...> --- src/NAnt.NUnit/NUnit2/NUnit2Task.cs | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) diff --git a/src/NAnt.NUnit/NUnit2/NUnit2Task.cs b/src/NAnt.NUnit/NUnit2/NUnit2Task.cs index 7cd7a19..2f0b732 100644 --- a/src/NAnt.NUnit/NUnit2/NUnit2Task.cs +++ b/src/NAnt.NUnit/NUnit2/NUnit2Task.cs @@ -190,7 +190,7 @@ namespace NAnt.NUnit2.Tasks { } LogWriter logWriter = new LogWriter(this, Level.Info, CultureInfo.InvariantCulture); - EventListener listener = new EventCollector(logWriter, logWriter); + EventListener listener = GetListener(logWriter); foreach (NUnit2Test testElement in Tests) { // Setup the test filter var to setup include/exclude filters. @@ -318,6 +318,25 @@ namespace NAnt.NUnit2.Tasks { #endregion Override implementation of Task + #region Protected Instance Methods + + /// <summary> + /// Gets a new EventListener to use for the unit tests. + /// </summary> + /// <returns> + /// A new EventListener created with a new EventCollector that + /// is initialized with <paramref name="logWriter"/>. + /// </returns> + /// <param name='logWriter'> + /// Log writer to send test output to. + /// </param> + protected virtual EventListener GetListener(LogWriter logWriter) + { + return new EventCollector(logWriter, logWriter); + } + + #endregion Protected Instance Methods + #region Private Instance Methods // TODO: Uncomment this section once NUnit is upgraded to version 2.6 -- 1.7.7 |