forked from microsoft/vstest
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
comming changes for microsoft#958 fix
- Loading branch information
1 parent
f990416
commit defaf23
Showing
14 changed files
with
136 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...Microsoft.TestPlatform.CrossPlatEngine/Execution/TestExtenstionInitializeEventsHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Microsoft.VisualStudio.TestPlatform.Common.Logging; | ||
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution | ||
{ | ||
public class TestExtenstionInitializeEventsHandler : ITestExtenstionInitializeEventsHandler | ||
{ | ||
private ITestRequestHandler requestHandler; | ||
|
||
private TestSessionMessageLogger testRunHandler; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="TestMessageEventHandler"/> class. | ||
/// </summary> | ||
/// <param name="requestHandler">test request handler</param> | ||
public TestExtenstionInitializeEventsHandler(ITestRequestHandler requestHandler) | ||
{ | ||
this.requestHandler = requestHandler; | ||
testRunHandler = TestSessionMessageLogger.Instance; | ||
} | ||
|
||
public void SubscribetoSessionEvent() | ||
{ | ||
testRunHandler.TestRunMessage += TestRunHandler_TestRunMessage; | ||
} | ||
|
||
public void UnSubscribetoSessionEvent() | ||
{ | ||
testRunHandler.TestRunMessage -= TestRunHandler_TestRunMessage; | ||
} | ||
|
||
private void TestRunHandler_TestRunMessage(object sender, TestRunMessageEventArgs e) | ||
{ | ||
HandleLogMessage(e.Level, e.Message); | ||
} | ||
|
||
/// <summary> | ||
/// Handles a test run message. | ||
/// </summary> | ||
/// <param name="level"> The level. </param> | ||
/// <param name="message"> The message. </param> | ||
public void HandleLogMessage(TestMessageLevel level, string message) | ||
{ | ||
switch ((TestMessageLevel)level) | ||
{ | ||
case TestMessageLevel.Informational: | ||
EqtTrace.Info(message); | ||
break; | ||
|
||
case TestMessageLevel.Warning: | ||
EqtTrace.Warning(message); | ||
break; | ||
|
||
case TestMessageLevel.Error: | ||
EqtTrace.Error(message); | ||
break; | ||
|
||
default: | ||
EqtTrace.Info(message); | ||
break; | ||
} | ||
|
||
this.requestHandler.SendLog(level, message); | ||
} | ||
|
||
public void HandleRawMessage(string rawMessage) | ||
{ | ||
// No-Op | ||
// TestHost at this point has no functionality where it requires rawmessage | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters