mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:59:16 +02:00
test results: implemented showing failure message.
git-svn-id: trunk@16112 -
This commit is contained in:
parent
520a6b0648
commit
0664276f37
@ -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);
|
||||
|
@ -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,'<','<',[rfReplaceAll]);
|
||||
Result:=StringReplace(Result,'>','>',[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;
|
||||
|
Loading…
Reference in New Issue
Block a user