Allow TestSteps to access results from other steps
The idea would be to allow TestSteps access to the Results published from other steps.
We would implement this as a ResultsListener internally in OpenTAP. Even though this will then be async and involve some thread sync, it should be fairly fast and not held up by other slower ResultListeners.
The Result Listener would find new ResultSink
type objects on TestSteps in the testplan, and populate those with results as described by the Sink object.
A TestStep would have a public property of this ResultSink
type if it needed some data from another step. The sink object would have members to describe what data is needed. Conceptually this type could look like this:
/// <summary>
/// Object used to indicate that a TestStep is interested in results from another TestStep.
/// A public property of this type should exist on the interested TestStep.
/// OpenTAP will detect properties on TestSteps of this type, and call the methods this interface defines.
/// </summary>
public interface IResultSink
{
/// <summary>
/// Called by OpenTAP when a TestStep publishes results. This is happening in a background thread.
/// </summary>
void ResultPublished(TestStepRun run, ResultTable table);
/// <summary>
/// Called by OpenTAP when a TestPlan run starts.
/// </summary>
void Open();
/// <summary>
/// Called by OpenTAP when the TestPlan completes.
/// </summary>
void Close();
}