test result db:

* import error messages
* use fixed EscapeText

git-svn-id: trunk@16113 -
This commit is contained in:
vincents 2008-08-18 12:16:46 +00:00
parent 0664276f37
commit f4a2211690
4 changed files with 8 additions and 11 deletions

View File

@ -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;

View File

@ -20,6 +20,7 @@ unit teststr;
interface
const
error = 'Error';
failed = 'Failed';
success = 'OK';
skipped = 'Ignored';

View File

@ -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'
);

View File

@ -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,'<','&lt;',[rfReplaceAll]);
Result:=StringReplace(Result,'>','&gt;',[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;