mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 09:38:12 +02:00
test result db:
* import error messages * use fixed EscapeText git-svn-id: trunk@16113 -
This commit is contained in:
parent
0664276f37
commit
f4a2211690
@ -457,7 +457,6 @@ procedure ProcessTestListing;
|
||||
TestResult, TestLog: string;
|
||||
TS: TTestStatus;
|
||||
ID: LongInt;
|
||||
i: Integer;
|
||||
begin
|
||||
Name := ATestElement.GetAttribute('Name');
|
||||
TestResult := ATestElement.GetAttribute('Result');
|
||||
@ -467,7 +466,7 @@ procedure ProcessTestListing;
|
||||
ID := RequireTestID(FullName);
|
||||
TS:=GetTestStatus(TestResult);
|
||||
Verbose(V_Debug,'Test result: '+TestResult+' TestStatus: '+IntToStr(ord(TS)));
|
||||
if TS=stFailed then
|
||||
if TS in [stFailed, stError] then
|
||||
TestLog := ATestElement.FindNode('Message').TextContent;
|
||||
AddTestResult(ID,TestRunID,Ord(TS),TestOK[TS],TestSkipped[TS],TestLog);
|
||||
end;
|
||||
|
@ -20,6 +20,7 @@ unit teststr;
|
||||
interface
|
||||
|
||||
const
|
||||
error = 'Error';
|
||||
failed = 'Failed';
|
||||
success = 'OK';
|
||||
skipped = 'Ignored';
|
||||
|
@ -29,6 +29,7 @@ Type
|
||||
TTestStatus = (
|
||||
stOK,
|
||||
stFailed,
|
||||
stError,
|
||||
stIgnored
|
||||
);
|
||||
|
||||
@ -40,24 +41,28 @@ Const
|
||||
TestOK : Array[TTestStatus] of Boolean = (
|
||||
True, // stOK
|
||||
False, // stFailed
|
||||
False, // stError
|
||||
False // stIgnored
|
||||
);
|
||||
|
||||
TestSkipped : Array[TTestStatus] of Boolean = (
|
||||
False, // stOK
|
||||
False, // stFailed
|
||||
False, // stError
|
||||
True // stIgnored
|
||||
);
|
||||
|
||||
StatusText : Array[TTestStatus] of String = (
|
||||
success,
|
||||
failed,
|
||||
error,
|
||||
skipped
|
||||
);
|
||||
|
||||
SQLField : Array[TTestStatus] of String = (
|
||||
'TU_OK',
|
||||
'TU_FAILED',
|
||||
'TU_ERROR',
|
||||
'TU_SKIPPED'
|
||||
);
|
||||
|
||||
|
@ -856,14 +856,6 @@ 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';
|
||||
@ -1006,7 +998,7 @@ begin
|
||||
Write('Log of '+FRunId+':');
|
||||
HeaderEnd(2);
|
||||
PreformatStart;
|
||||
system.Write(MyEscapeHTML(Log));
|
||||
system.Write(EscapeText(Log));
|
||||
system.flush(output);
|
||||
PreformatEnd;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user