Table of Contents

Interface ITestProcess

Namespace
Xunit.v3
Assembly
xunit.v3.runner.utility.netfx.dll

Represents a v3 test process that has been launched. When the process is disposed, it should be allowed to cleaned up and exit within an appropriate amount of time, and then killed if it will not stop cleanly.

public interface ITestProcess : IDisposable
Inherited Members

Properties

HasExited

Gets a flag to indicate whether the test process has exited or not yet.

bool HasExited { get; }

Property Value

bool

StandardInput

Gets a TextWriter that can be used to write text from the standard input of the test process.

TextWriter StandardInput { get; }

Property Value

TextWriter

StandardOutput

Gets a TextReader that can be used to read text from the standard output of the test process.

TextReader StandardOutput { get; }

Property Value

TextReader

Methods

Cancel(bool)

Cancels the test pipeline, forcefully if necessary.

void Cancel(bool forceCancellation)

Parameters

forceCancellation bool

When set to false, this should request graceful termination of the test pipeline; when set to true, the test process should be forcefully shut down as quickly as possible.

Remarks

Note that repeated calls to this method with forceCancellation set to false may be possible, since it may be dispatched every time a remote runner returns false from a message sink/message bus call. For out of process runners using Ctrl+C via standard input, it should only send Ctrl+C the first time this is called (since double Ctrl+C is the forceful cancellation signal).

WaitForExit(int)

Wait for the specified number of milliseconds for the test process to exit.

bool WaitForExit(int milliseconds)

Parameters

milliseconds int

The amount of time, in milliseconds, to wait

Returns

bool

Returns true if the process exited; false, otherwise