PrintErrors method
Prints the errors to the standard output

Applies to
TTextTestListener

Declaration
Function PrintErrors(r :TTestResult): string;

Implementation

function TTextTestListener.PrintErrors(r :TTestResult) :string;
var
  i       :integer;
  error   :TTestFailure;
begin
    result := '';
    if (r.errorCount <> 0) then begin
        if (r.errorCount = 1) then
            result := result + format('There was %d error:', [r.errorCount]) + CRLF
        else
            result := result + format('There were %d errors:', [r.errorCount]) + CRLF;

        for i := 0 to r.errors.Count-1 do begin
            error :=  TObject(r.errors[i]) as TTestFailure;
            result := result + format('%d) %s: %s: %s', [
                                       i+1,
                                       error.failedTest.name,
                                       error.thrownExceptionName,
                                       error.thrownExceptionMessage
                                       ]) + CRLF;
        end;
        result := result + CRLF
    end
End;


HTML generated by Time2HELP
http://www.time2help.com