Run method |
Applies to
TTestResult
Declaration
Procedure Run(test: TTestCase);
Description
Run executes a test cases and broadcasts status informatio to any listeners registered with this TTestResult. Run also records any failures or errors that occur while running the testcase. Implementation
procedure TTestResult.Run(test: TTestCase); begin assert(assigned(test)); if ShouldStop then EXIT; StartTest(test); try try test.SetUp; except on e: Exception do begin AddError(test, e, 'SetUp FAILED: '); EXIT; end end; try test.RunTest; except on e: EStopTestsFailure do begin AddFailure(test, e); FStop := True; end; on e: ETestFailure do begin AddFailure(test, e); end; on e: EBreakingTestFailure do begin AddFailure(test, e); end; on e: Exception do begin AddError(test, e); end; end; try test.TearDown; except on e: Exception do AddError(test, e, 'TearDown FAILED: '); end; finally EndTest(test); end; End; |
|