forked from microsoft/vstest
/
ITestRequestSender.cs
101 lines (85 loc) · 3.79 KB
/
ITestRequestSender.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces
{
using System;
using System.Collections.Generic;
using System.Threading;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
/// <summary>
/// Defines contract to send test platform requests to test host
/// </summary>
public interface ITestRequestSender : IDisposable
{
/// <summary>
/// Initializes the communication for sending requests
/// </summary>
/// <returns>Port Number of the communication channel</returns>
int InitializeCommunication();
/// <summary>
/// Used for protocol version check with TestHost
/// </summary>
void CheckVersionWithTestHost();
/// <summary>
/// Waits for Request Handler to be connected
/// </summary>
/// <param name="connectionTimeout">Time to wait for connection</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>True, if Handler is connected</returns>
bool WaitForRequestHandlerConnection(int connectionTimeout, CancellationToken cancellationToken);
/// <summary>
/// Close the Sender
/// </summary>
void Close();
/// <summary>
/// Initializes the Discovery
/// </summary>
/// <param name="pathToAdditionalExtensions">Paths to check for additional extensions</param>
void InitializeDiscovery(IEnumerable<string> pathToAdditionalExtensions);
/// <summary>
/// Initializes the Execution
/// </summary>
/// <param name="pathToAdditionalExtensions">Paths to check for additional extensions</param>
void InitializeExecution(IEnumerable<string> pathToAdditionalExtensions);
/// <summary>
/// Discovers the tests
/// </summary>
/// <param name="discoveryCriteria">DiscoveryCriteria for discovery</param>
/// <param name="discoveryEventsHandler">EventHandler for discovery events</param>
void DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 discoveryEventsHandler);
/// <summary>
/// Starts the TestRun with given sources and criteria
/// </summary>
/// <param name="runCriteria">RunCriteria for test run</param>
/// <param name="eventHandler">EventHandler for test run events</param>
void StartTestRun(TestRunCriteriaWithSources runCriteria, ITestRunEventsHandler eventHandler);
/// <summary>
/// Starts the TestRun with given test cases and criteria
/// </summary>
/// <param name="runCriteria">RunCriteria for test run</param>
/// <param name="eventHandler">EventHandler for test run events</param>
void StartTestRun(TestRunCriteriaWithTests runCriteria, ITestRunEventsHandler eventHandler);
/// <summary>
/// Ends the Session
/// </summary>
void EndSession();
/// <summary>
/// Send the request to cancel the test run
/// </summary>
void SendTestRunCancel();
/// <summary>
/// Send the request to abort the test run
/// </summary>
void SendTestRunAbort();
/// <summary>
/// Send the request to cancel the test discovery
/// </summary>
void SendTestDiscoveryCancel();
/// <summary>
/// Handle client process exit
/// </summary>
/// <param name="stdError">Standard error output</param>
void OnClientProcessExit(string stdError);
}
}