test results: implemented showing failure message.

git-svn-id: trunk@16112 -
This commit is contained in:
vincents 2008-08-18 10:45:55 +00:00
parent 520a6b0648
commit 0664276f37
2 changed files with 14 additions and 6 deletions

View File

@ -454,21 +454,22 @@ procedure ProcessTestListing;
procedure ProcessTest(ATestElement: TDOMElement; APath: string);
var
Name, FullName: string;
TestResult: string;
TestResult, TestLog: string;
TS: TTestStatus;
ID: LongInt;
i: Integer;
begin
Name := ATestElement.GetAttribute('Name');
TestResult := ATestElement.GetAttribute('Result');
TestLog := '';
Verbose(V_NORMAL,'Analysing result for test '+Name);
for i := 0 to ATestElement.Attributes.Length-1 do
Verbose(V_NORMAL,ATestElement.Attributes[i].NodeName+ '=' + ATestElement.Attributes[i].NodeValue);
FullName := APath + '|' + Name;
ID := RequireTestID(FullName);
TS:=GetTestStatus(TestResult);
Verbose(V_Debug,'Test result: '+TestResult+' TestStatus: '+IntToStr(ord(TS)));
AddTestResult(ID,TestRunID,Ord(TS),TestOK[TS],TestSkipped[TS],'No log yet');
if TS=stFailed then
TestLog := ATestElement.FindNode('Message').TextContent;
AddTestResult(ID,TestRunID,Ord(TS),TestOK[TS],TestSkipped[TS],TestLog);
end;
procedure ProcessNodes(AParentNode: TDomNode; APath: string);

View File

@ -80,7 +80,6 @@ Type
Procedure ShowRunOverview;
Procedure CreateRunPie;
Function ShowRunData : Boolean;
end;
implementation
@ -857,6 +856,14 @@ Var
FieldName,FieldValue,
Log,Source : String;
Res : Boolean;
function MyEscapeHTML(const AText: string): string;
begin
// replace by a more sensitive method.
Result:=StringReplace(AText,'&','&',[rfReplaceAll]);
Result:=StringReplace(Result,'<','&lt;',[rfReplaceAll]);
Result:=StringReplace(Result,'>','&gt;',[rfReplaceAll]);
Result:=StringReplace(Result,#10,'<BR>',[rfreplaceAll]);
end;
begin
ConnectToDB;
ContentType:='text/html';
@ -999,7 +1006,7 @@ begin
Write('Log of '+FRunId+':');
HeaderEnd(2);
PreformatStart;
system.Write(Log);
system.Write(MyEscapeHTML(Log));
system.flush(output);
PreformatEnd;
end;