mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 20:09:20 +02:00
* more updates
git-svn-id: trunk@14614 -
This commit is contained in:
parent
86d8b09077
commit
c39c87096a
@ -12,9 +12,8 @@ const
|
|||||||
TestsuiteURLPrefix='http://www.freepascal.org/testsuite/';
|
TestsuiteURLPrefix='http://www.freepascal.org/testsuite/';
|
||||||
TestsuiteBin='testsuite.cgi';
|
TestsuiteBin='testsuite.cgi';
|
||||||
ViewURL='http://svn.freepascal.org/cgi-bin/viewvc.cgi/';
|
ViewURL='http://svn.freepascal.org/cgi-bin/viewvc.cgi/';
|
||||||
ViewVCTrunkURL=ViewURL+'trunk/tests/';
|
TestsSubDir='/tests/';
|
||||||
ViewVCBranchURL=ViewURL+'%s/tests/';
|
DataBaseSubDir='/packages/fcl-db/tests/';
|
||||||
ViewVCDataBaseURL=ViewURL+'trunk/packages/fcl-db/tests/';
|
|
||||||
var
|
var
|
||||||
TestsuiteCGIURL : string;
|
TestsuiteCGIURL : string;
|
||||||
Type
|
Type
|
||||||
@ -30,6 +29,10 @@ Type
|
|||||||
FTestFileName,
|
FTestFileName,
|
||||||
FVersion,
|
FVersion,
|
||||||
FVersionBranch,
|
FVersionBranch,
|
||||||
|
FCond,
|
||||||
|
FSubmitter,
|
||||||
|
FMachine,
|
||||||
|
FComment,
|
||||||
FCPU,
|
FCPU,
|
||||||
FOS : String;
|
FOS : String;
|
||||||
FViewVCURL : String;
|
FViewVCURL : String;
|
||||||
@ -72,6 +75,7 @@ Type
|
|||||||
Procedure ShowRunResults;
|
Procedure ShowRunResults;
|
||||||
Procedure ShowRunComparison;
|
Procedure ShowRunComparison;
|
||||||
Procedure ShowOneTest;
|
Procedure ShowOneTest;
|
||||||
|
Procedure ShowHistory;
|
||||||
Function ConnectToDB : Boolean;
|
Function ConnectToDB : Boolean;
|
||||||
procedure DisconnectFromDB;
|
procedure DisconnectFromDB;
|
||||||
Procedure EmitTitle(ATitle : String);
|
Procedure EmitTitle(ATitle : String);
|
||||||
@ -102,6 +106,21 @@ type
|
|||||||
known_versions = (
|
known_versions = (
|
||||||
ver_unknown,
|
ver_unknown,
|
||||||
ver_1_0_10,
|
ver_1_0_10,
|
||||||
|
ver_2_0_0,
|
||||||
|
ver_2_0_1,
|
||||||
|
ver_2_0_2,
|
||||||
|
ver_2_0_3,
|
||||||
|
ver_2_0_4,
|
||||||
|
ver_2_0_5,
|
||||||
|
ver_2_1_2,
|
||||||
|
ver_2_1_4,
|
||||||
|
ver_2_2_0,
|
||||||
|
ver_2_2_1,
|
||||||
|
ver_2_2_2,
|
||||||
|
ver_2_2_3,
|
||||||
|
ver_2_2_4,
|
||||||
|
ver_2_2_5,
|
||||||
|
ver_2_3_1,
|
||||||
ver_2_4_0,
|
ver_2_4_0,
|
||||||
ver_2_4_1,
|
ver_2_4_1,
|
||||||
ver_2_5_1);
|
ver_2_5_1);
|
||||||
@ -114,6 +133,21 @@ const
|
|||||||
(
|
(
|
||||||
'unknown',
|
'unknown',
|
||||||
'1.0.10',
|
'1.0.10',
|
||||||
|
'2.0.0',
|
||||||
|
'2.0.1',
|
||||||
|
'2.0.2',
|
||||||
|
'2.0.3',
|
||||||
|
'2.0.4',
|
||||||
|
'2.0.5',
|
||||||
|
'2.1.2',
|
||||||
|
'2.1.4',
|
||||||
|
'2.2.0',
|
||||||
|
'2.2.1',
|
||||||
|
'2.2.2',
|
||||||
|
'2.2.3',
|
||||||
|
'2.2.4',
|
||||||
|
'2.2.5',
|
||||||
|
'2.3.1',
|
||||||
'2.4.0',
|
'2.4.0',
|
||||||
'2.4.1',
|
'2.4.1',
|
||||||
'2.5.1'
|
'2.5.1'
|
||||||
@ -123,6 +157,21 @@ const
|
|||||||
(
|
(
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
|
'tags/release_2_0_0',
|
||||||
|
'branches/fixes_2_0',
|
||||||
|
'tags/release_2_0_2',
|
||||||
|
'branches/fixes_2_0',
|
||||||
|
'tags/release_2_0_4',
|
||||||
|
'branches/fixes_2_0',
|
||||||
|
'tags/release_2_1_2',
|
||||||
|
'tags/release_2_1_4',
|
||||||
|
'tags/release_2_2_0',
|
||||||
|
'branches/fixes_2_2',
|
||||||
|
'tags/release_2_2_2',
|
||||||
|
'branches/fixes_2_2',
|
||||||
|
'tags/release_2_2_4',
|
||||||
|
'branches/fixes_2_2',
|
||||||
|
'tags/release_2_4_0',
|
||||||
'tags/release_2_4_0',
|
'tags/release_2_4_0',
|
||||||
'branches/fixes_2_4',
|
'branches/fixes_2_4',
|
||||||
'trunk'
|
'trunk'
|
||||||
@ -142,6 +191,7 @@ begin
|
|||||||
ShowRunComparison;
|
ShowRunComparison;
|
||||||
2 : CreateRunPie;
|
2 : CreateRunPie;
|
||||||
3 : ShowOneTest;
|
3 : ShowOneTest;
|
||||||
|
4 : ShowHistory;
|
||||||
{$ifdef TEST}
|
{$ifdef TEST}
|
||||||
98 :
|
98 :
|
||||||
begin
|
begin
|
||||||
@ -200,6 +250,19 @@ begin
|
|||||||
FCPU:=RequestVariables['cpu'];
|
FCPU:=RequestVariables['cpu'];
|
||||||
if Length(FCPU) = 0 then
|
if Length(FCPU) = 0 then
|
||||||
FCPU:=RequestVariables['TESTCPU'];
|
FCPU:=RequestVariables['TESTCPU'];
|
||||||
|
FCond:=RequestVariables['cond'];
|
||||||
|
if Length(FCond) = 0 then
|
||||||
|
FCond:=RequestVariables['TESTCOND'];
|
||||||
|
FComment:=RequestVariables['comment'];
|
||||||
|
if Length(FComment) = 0 then
|
||||||
|
FComment:=RequestVariables['TESTCOMMENT'];
|
||||||
|
FSubmitter:=RequestVariables['submitter'];
|
||||||
|
if Length(FSubmitter) = 0 then
|
||||||
|
FSubmitter:=RequestVariables['TESTSUBMITTER'];
|
||||||
|
FMachine:=RequestVariables['machine'];
|
||||||
|
if Length(FMachine) = 0 then
|
||||||
|
FMachine:=RequestVariables['TESTMACHINE'];
|
||||||
|
|
||||||
FRunID:=RequestVariables['run1id'];
|
FRunID:=RequestVariables['run1id'];
|
||||||
if Length(FRunID) = 0 then
|
if Length(FRunID) = 0 then
|
||||||
FRunID:=RequestVariables['TESTRUN'];
|
FRunID:=RequestVariables['TESTRUN'];
|
||||||
@ -350,6 +413,9 @@ begin
|
|||||||
Write('Please specify search criteria:');
|
Write('Please specify search criteria:');
|
||||||
ParagraphStart;
|
ParagraphStart;
|
||||||
FormStart(TestsuiteCGIURL,'');
|
FormStart(TestsuiteCGIURL,'');
|
||||||
|
if FDebug then
|
||||||
|
EmitHiddenVar('DEBUGCGI', '1');
|
||||||
|
|
||||||
TableStart(2,true);
|
TableStart(2,true);
|
||||||
RowStart;
|
RowStart;
|
||||||
CellStart;
|
CellStart;
|
||||||
@ -378,6 +444,46 @@ begin
|
|||||||
else
|
else
|
||||||
EmitInput('date',DateToStr(FDate));
|
EmitInput('date',DateToStr(FDate));
|
||||||
CellEnd;
|
CellEnd;
|
||||||
|
if FDebug then
|
||||||
|
begin
|
||||||
|
RowNext;
|
||||||
|
CellStart;
|
||||||
|
Write('Submitter');
|
||||||
|
CellNext;
|
||||||
|
If (FSubmitter='') then
|
||||||
|
EmitInput('submitter','')
|
||||||
|
else
|
||||||
|
EmitInput('submitter',FSubmitter);
|
||||||
|
CellEnd;
|
||||||
|
RowNext;
|
||||||
|
CellStart;
|
||||||
|
Write('Machine');
|
||||||
|
CellNext;
|
||||||
|
If (FMachine='') then
|
||||||
|
EmitInput('machine','')
|
||||||
|
else
|
||||||
|
EmitInput('machine',FMachine);
|
||||||
|
CellEnd;
|
||||||
|
RowNext;
|
||||||
|
CellStart;
|
||||||
|
Write('Comment');
|
||||||
|
CellNext;
|
||||||
|
If (FComment='') then
|
||||||
|
EmitInput('comment','')
|
||||||
|
else
|
||||||
|
EmitInput('comment',FComment);
|
||||||
|
CellEnd;
|
||||||
|
|
||||||
|
RowNext;
|
||||||
|
CellStart;
|
||||||
|
Write('Cond');
|
||||||
|
CellNext;
|
||||||
|
If (FCond='') then
|
||||||
|
EmitInput('cond','')
|
||||||
|
else
|
||||||
|
EmitInput('cond',FCond);
|
||||||
|
CellEnd;
|
||||||
|
end;
|
||||||
RowNext;
|
RowNext;
|
||||||
CellStart;
|
CellStart;
|
||||||
Write('Only failed tests');
|
Write('Only failed tests');
|
||||||
@ -504,7 +610,15 @@ begin
|
|||||||
if (FOS<>'') and (GetOSName(FOS)<>'All') then
|
if (FOS<>'') and (GetOSName(FOS)<>'All') then
|
||||||
S:=S+' AND (TU_OS_FK='+FOS+')';
|
S:=S+' AND (TU_OS_FK='+FOS+')';
|
||||||
If (Round(FDate)<>0) then
|
If (Round(FDate)<>0) then
|
||||||
S:=S+' AND (TU_DATE="'+FormatDateTime('YYYY/MM/DD',FDate)+'")';
|
S:=S+' AND (TU_DATE LIKE '''+FormatDateTime('YYYY-MM-DD',FDate)+'%'')';
|
||||||
|
If FSubmitter<>'' then
|
||||||
|
S:=S+' AND (TU_SUBMITTER='''+FSubmitter+''')';
|
||||||
|
If FMachine<>'' then
|
||||||
|
S:=S+' AND TU_MACHINE='''+FMachine+''')';
|
||||||
|
If FComment<>'' then
|
||||||
|
S:=S+' AND TU_COMMENT='''+Fcomment+''')';
|
||||||
|
If FCond<>'' then
|
||||||
|
S:=S+' AND ('+FCond+')';
|
||||||
If FOnlyFailed then
|
If FOnlyFailed then
|
||||||
S:=S+' AND (TR_OK="-")';
|
S:=S+' AND (TR_OK="-")';
|
||||||
A:=SDetailsURL;
|
A:=SDetailsURL;
|
||||||
@ -827,7 +941,7 @@ Procedure TTestSuite.ShowOneTest;
|
|||||||
Var
|
Var
|
||||||
S : String;
|
S : String;
|
||||||
Qry : String;
|
Qry : String;
|
||||||
Category : string;
|
Base, Category : string;
|
||||||
Q : TSQLQuery;
|
Q : TSQLQuery;
|
||||||
i : longint;
|
i : longint;
|
||||||
FieldName,FieldValue,
|
FieldName,FieldValue,
|
||||||
@ -946,6 +1060,7 @@ begin
|
|||||||
Border:=True;
|
Border:=True;
|
||||||
//FL:='TR_ID,TR_TESTRUN_FK,T_NAME,T_CPU,T_VERSION';
|
//FL:='TR_ID,TR_TESTRUN_FK,T_NAME,T_CPU,T_VERSION';
|
||||||
CreateColumns(Nil);
|
CreateColumns(Nil);
|
||||||
|
TableColumns.Delete(TableColumns.ColumnByName('TR_TEST_FK').Index);
|
||||||
TableColumns.ColumnByNAme('TR_TESTRUN_FK').OnGetCellContents:=
|
TableColumns.ColumnByNAme('TR_TESTRUN_FK').OnGetCellContents:=
|
||||||
@FormatTestRunOverview;
|
@FormatTestRunOverview;
|
||||||
//OnGetRowAttributes:=@GetRunRowAttr;
|
//OnGetRowAttributes:=@GetRunRowAttr;
|
||||||
@ -964,6 +1079,7 @@ begin
|
|||||||
Free;
|
Free;
|
||||||
end;
|
end;
|
||||||
//If FDebug then
|
//If FDebug then
|
||||||
|
Category:='1';
|
||||||
if FRunId<>'' then
|
if FRunId<>'' then
|
||||||
begin
|
begin
|
||||||
Category:=getsingleton('select TU_CATEGORY_FK from TESTRUN where TU_ID='+FRunId);
|
Category:=getsingleton('select TU_CATEGORY_FK from TESTRUN where TU_ID='+FRunId);
|
||||||
@ -1032,20 +1148,351 @@ begin
|
|||||||
PreformatEnd;
|
PreformatEnd;
|
||||||
end;
|
end;
|
||||||
Finally
|
Finally
|
||||||
FViewVCURL:=ViewVCTrunkURL;
|
Base:='trunk';
|
||||||
if FVersionBranch<>'' then
|
if FVersionBranch<>'' then
|
||||||
begin
|
begin
|
||||||
// Test all but last version, which is assumed to be trunk
|
// Test all but last version, which is assumed to be trunk
|
||||||
for ver:=low(known_versions) to pred(high(known_versions)) do
|
for ver:=low(known_versions) to pred(high(known_versions)) do
|
||||||
if ver_string[ver]=FVersionBranch then
|
if ver_string[ver]=FVersionBranch then
|
||||||
begin
|
begin
|
||||||
FViewVCURL:=Format(ViewVCBranchURL,[ver_branch[ver]]);
|
base:=ver_branch[ver];
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if Category<>'1' then
|
FViewVCURL:=ViewURL+Base;
|
||||||
|
if Category='1' then
|
||||||
|
FViewVCUrl:=FViewVCURL+TestsSubDir
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
FViewVCURL:=ViewVCDatabaseURL;
|
FViewVCUrl:=FViewVCURL+DataBaseSubDir;
|
||||||
|
// This assumes that type TAnyType is
|
||||||
|
// defined in anytype.pas source PM
|
||||||
|
if pos('/',FTestFileName)>0 then
|
||||||
|
FTestfilename:=lowercase(copy(FTestFilename,2,pos('/',FTestFilename)-2)+'.pas');
|
||||||
|
end;
|
||||||
|
if Source='' then
|
||||||
|
begin
|
||||||
|
HeaderStart(3);
|
||||||
|
DumpLn('<P>No Source in TestSuite DataBase.</P>');
|
||||||
|
DumpLn('Link to SVN view of '+
|
||||||
|
'<A HREF="'+FViewVCURL+FTestFileName+'?view=markup'+
|
||||||
|
'" TARGET="_blank"> '+FTestFileName+'</A> source. ');
|
||||||
|
HeaderEnd(3);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
HeaderStart(3);
|
||||||
|
DumpLn('Link to SVN view of '+
|
||||||
|
'<A HREF="'+FViewVCURL+FTestFileName+'?view=markup'+
|
||||||
|
'" TARGET="_blank"> '+FTestFileName+'</A> source. ');
|
||||||
|
HeaderEnd(3);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if FDebug then
|
||||||
|
Write('After Source.');
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Write(Format('No data for test file with ID: %s',[FTestFileID]));
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Procedure TTestSuite.ShowHistory;
|
||||||
|
|
||||||
|
Var
|
||||||
|
S,FL : String;
|
||||||
|
Qry : String;
|
||||||
|
Base, Category : string;
|
||||||
|
Q : TSQLQuery;
|
||||||
|
i : longint;
|
||||||
|
error : word;
|
||||||
|
OK_count, not_OK_count,resi,
|
||||||
|
total_count, skip_count, not_skip_count : longint;
|
||||||
|
TS : TTestStatus;
|
||||||
|
result_count : array[TTestStatus] of longint;
|
||||||
|
FieldName,FieldValue,
|
||||||
|
Log,Source : String;
|
||||||
|
Res : Boolean;
|
||||||
|
ver : known_versions;
|
||||||
|
begin
|
||||||
|
ConnectToDB;
|
||||||
|
ContentType:='text/html';
|
||||||
|
EmitContentType;
|
||||||
|
if FTestFileID='' then
|
||||||
|
FTestFileID:=GetSingleton('SELECT T_ID FROM TESTS WHERE T_NAME LIKE ''%'+
|
||||||
|
FTestFileName+'%''');
|
||||||
|
if FTestFileID<>'' then
|
||||||
|
FTestFileName:=GetTestFileName(FTestFileID);
|
||||||
|
EmitTitle(Title+' : File '+FTestFileName+' Results');
|
||||||
|
With FHTMLWriter do
|
||||||
|
begin
|
||||||
|
HeaderStart(1);
|
||||||
|
Write('Test suite results for test file '+FTestFileName);
|
||||||
|
HeaderEnd(1);
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('Test run data : ');
|
||||||
|
HeaderEnd(2);
|
||||||
|
if FRunID<>'' then
|
||||||
|
begin
|
||||||
|
Res:=ShowRunData;
|
||||||
|
Res:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
// This is useless as it is now
|
||||||
|
// It should be integrated into a form probably PM
|
||||||
|
Write('Only failed tests');
|
||||||
|
EmitCheckBox('failedonly','1',FonlyFailed);
|
||||||
|
Write('Hide skipped tests');
|
||||||
|
EmitCheckBox('noskipped','1',FNoSkipped);
|
||||||
|
Res:=true;
|
||||||
|
end;
|
||||||
|
If Res then
|
||||||
|
begin
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('Test file "'+FTestFileName+'" information:');
|
||||||
|
HeaderEnd(2);
|
||||||
|
ParaGraphStart;
|
||||||
|
if FTestFileID<>'' then
|
||||||
|
S:='SELECT * FROM TESTS WHERE T_ID='+FTestFileID
|
||||||
|
else
|
||||||
|
S:='SELECT * FROM TESTS WHERE T_NAME='+FTestFileName;
|
||||||
|
Q:=CreateDataSet(S);
|
||||||
|
With Q do
|
||||||
|
Try
|
||||||
|
Open;
|
||||||
|
Try
|
||||||
|
For i:=0 to FieldCount-1 do
|
||||||
|
begin
|
||||||
|
FieldValue:=Fields[i].AsString;
|
||||||
|
FieldName:=Fields[i].DisplayName;
|
||||||
|
|
||||||
|
if (FieldValue<>'') and (FieldValue<>'-') and
|
||||||
|
(FieldName<>'T_NAME') and (FieldName<>'T_SOURCE') then
|
||||||
|
begin
|
||||||
|
if (FieldValue='+') then
|
||||||
|
Write('Flag ');
|
||||||
|
Write(FieldName);
|
||||||
|
Write(' ');
|
||||||
|
if FieldValue='+' then
|
||||||
|
Write(' set')
|
||||||
|
else
|
||||||
|
Write(FieldValue);
|
||||||
|
DumpLn('<BR>');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Finally
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
Finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
ParaGraphEnd;
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('Detailed test run results:');
|
||||||
|
|
||||||
|
HeaderEnd(2);
|
||||||
|
ParaGraphStart;
|
||||||
|
S:='SELECT TR_ID,TR_TESTRUN_FK,TR_TEST_FK,TR_OK, TR_SKIP,TR_RESULT '
|
||||||
|
//S:='SELECT * '
|
||||||
|
+',TU_ID,TU_DATE,TU_SUBMITTER,TU_MACHINE,TU_COMMENT '
|
||||||
|
+' FROM TESTRUN LEFT JOIN TESTRESULTS ON (TR_TESTRUN_FK=TU_ID)'
|
||||||
|
+' WHERE (TR_TEST_FK='+FTestFileID+')'
|
||||||
|
+' AND (TR_TESTRUN_FK=TU_ID)';
|
||||||
|
If FOnlyFailed then
|
||||||
|
S:=S+' AND (TR_OK="-")';
|
||||||
|
If FSubmitter<>'' then
|
||||||
|
S:=S+' AND (TU_SUBMITTER='''+FSubmitter+''')';
|
||||||
|
If FMachine<>'' then
|
||||||
|
S:=S+' AND (TU_MACHINE='''+FMachine+''')';
|
||||||
|
If FComment<>'' then
|
||||||
|
S:=S+' AND (TU_COMMENT='''+FComment+''')';
|
||||||
|
|
||||||
|
S:=S+' ORDER BY TU_ID DESC LIMIT '+IntToStr(FLimit);
|
||||||
|
Qry:=S;
|
||||||
|
If FDebug then
|
||||||
|
begin
|
||||||
|
Writeln(system.stdout,'Query : '+Qry);
|
||||||
|
system.Flush(system.stdout);
|
||||||
|
end;
|
||||||
|
FRunCount:=0;
|
||||||
|
FRunSkipCount:=0;
|
||||||
|
FRunFailedCount:=0;
|
||||||
|
Q:=CreateDataset(Qry);
|
||||||
|
With Q do
|
||||||
|
try
|
||||||
|
Open;
|
||||||
|
With CreateTableProducer(Q) do
|
||||||
|
Try
|
||||||
|
Border:=True;
|
||||||
|
FL:='TR_TESTRUN_FK,TU_DATE,TR_OK,TR_SKIP,TR_RESULT';
|
||||||
|
if FSubmitter='' then
|
||||||
|
FL:=FL+',TU_SUBMITTER';
|
||||||
|
if FMachine='' then
|
||||||
|
FL:=FL+',TU_MACHINE';
|
||||||
|
if Fcomment='' then
|
||||||
|
FL:=FL+',TU_COMMENT';
|
||||||
|
CreateColumns(FL);
|
||||||
|
//TableColumns.Delete(TableColumns.ColumnByName('TR_TEST_FK').Index);
|
||||||
|
TableColumns.ColumnByNAme('TR_TESTRUN_FK').OnGetCellContents:=
|
||||||
|
@FormatTestRunOverview;
|
||||||
|
//OnGetRowAttributes:=@GetRunRowAttr;
|
||||||
|
TableColumns.ColumnByNAme('TR_RESULT').OnGetCellContents:=
|
||||||
|
@FormatTestResult;
|
||||||
|
//(TableColumns.Items[0] as TTableColumn).ActionURL:=ALink;
|
||||||
|
CreateTable(Response);
|
||||||
|
Finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
DumpLn(Format('<p>Record count: %d </p>',[Q.RecordCount]));
|
||||||
|
|
||||||
|
Try
|
||||||
|
if FDebug then
|
||||||
|
begin
|
||||||
|
Writeln(stdout,'FieldKind=',Fields[0].FieldKind);
|
||||||
|
Writeln(stdout,'iDataType=',Fields[0].DataType);
|
||||||
|
system.flush(stdout);
|
||||||
|
end;
|
||||||
|
|
||||||
|
total_count:=0;
|
||||||
|
OK_count:=0;
|
||||||
|
not_OK_count:=0;
|
||||||
|
skip_count:=0;
|
||||||
|
not_skip_count:=0;
|
||||||
|
fillchar(Result_Count,Sizeof(Result_count),#0);
|
||||||
|
For i:=0 to Q.RecordCount-1 do
|
||||||
|
begin
|
||||||
|
Q.RecNo:=i;
|
||||||
|
inc(total_count);
|
||||||
|
S:=Fields[0].AsString;
|
||||||
|
if FDebug then
|
||||||
|
begin
|
||||||
|
Writeln(stdout,'i=',i);
|
||||||
|
Writeln(stdout,'S=',S);
|
||||||
|
system.flush(stdout);
|
||||||
|
end;
|
||||||
|
S:=Fields[3].AsString;
|
||||||
|
if S='+' then
|
||||||
|
inc(OK_count)
|
||||||
|
else
|
||||||
|
inc(not_OK_count);
|
||||||
|
S:=Fields[4].AsString;
|
||||||
|
if S='+' then
|
||||||
|
inc(skip_count)
|
||||||
|
else
|
||||||
|
inc(not_skip_count);
|
||||||
|
S:=Fields[5].AsString;
|
||||||
|
system.val(S,resi,error);
|
||||||
|
if (error=0) and (Resi>=longint(FirstStatus)) and
|
||||||
|
(Resi<=longint(LastStatus)) then
|
||||||
|
begin
|
||||||
|
TS:=TTestStatus(Resi);
|
||||||
|
inc(Result_count[TS]);
|
||||||
|
end
|
||||||
|
else if Fdebug then
|
||||||
|
writeln(stdout,'Error for Result, S=',S);
|
||||||
|
end;
|
||||||
|
DumpLn(Format('<p>Total = %d </p>',[total_count]));
|
||||||
|
DumpLn(Format('<p>OK=%d Percentage= %3.2f </p>',[OK_count,OK_count*100/total_count]));
|
||||||
|
For TS:=FirstStatus to LastStatus do
|
||||||
|
if Result_count[TS]>0 then
|
||||||
|
DumpLn(Format('%s=%d </p>', [StatusText[TS],Result_count[TS]]));
|
||||||
|
|
||||||
|
Finally
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
//If FDebug then
|
||||||
|
Category:='1';
|
||||||
|
if FRunId<>'' then
|
||||||
|
begin
|
||||||
|
Category:=getsingleton('select TU_CATEGORY_FK from TESTRUN where TU_ID='+FRunId);
|
||||||
|
FVersionBranch:=GetVersionName(getsingleton('select TU_VERSION_FK from TESTRUN where TU_ID='+fRunId));
|
||||||
|
log:='';
|
||||||
|
Try
|
||||||
|
log:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid
|
||||||
|
+') and (TR_TESTRUN_FK='+frunid+')');
|
||||||
|
if Log<>'' then
|
||||||
|
begin
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('Log of '+FRunId+':');
|
||||||
|
HeaderEnd(2);
|
||||||
|
PreformatStart;
|
||||||
|
system.Write(Log);
|
||||||
|
system.flush(output);
|
||||||
|
PreformatEnd;
|
||||||
|
end;
|
||||||
|
Finally
|
||||||
|
if Log='' then
|
||||||
|
begin
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('No log of '+FRunId+'.');
|
||||||
|
HeaderEnd(2);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if FCompareRunId<>'' then
|
||||||
|
begin
|
||||||
|
log:='';
|
||||||
|
Try
|
||||||
|
log:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid
|
||||||
|
+') and (TR_TESTRUN_FK='+fcomparerunid+')');
|
||||||
|
if Log<>'' then
|
||||||
|
begin
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('Log of '+FCompareRunId+':');
|
||||||
|
HeaderEnd(2);
|
||||||
|
PreformatStart;
|
||||||
|
system.Write(Log);
|
||||||
|
system.flush(output);
|
||||||
|
PreformatEnd;
|
||||||
|
end;
|
||||||
|
Finally
|
||||||
|
if Log='' then
|
||||||
|
begin
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('No log of '+FCompareRunId+'.');
|
||||||
|
HeaderEnd(2);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if FDebug then
|
||||||
|
Write('After Log.');
|
||||||
|
Source:='';
|
||||||
|
Try
|
||||||
|
Source:=getsingleton('select T_SOURCE from TESTS where T_ID='+ftestfileid);
|
||||||
|
if Source<>'' then
|
||||||
|
begin
|
||||||
|
HeaderStart(2);
|
||||||
|
Write('Source:');
|
||||||
|
HeaderEnd(2);
|
||||||
|
PreformatStart;
|
||||||
|
system.Write(Source);
|
||||||
|
system.flush(output);
|
||||||
|
PreformatEnd;
|
||||||
|
end;
|
||||||
|
Finally
|
||||||
|
Base:='trunk';
|
||||||
|
if FVersionBranch<>'' then
|
||||||
|
begin
|
||||||
|
// Test all but last version, which is assumed to be trunk
|
||||||
|
for ver:=low(known_versions) to pred(high(known_versions)) do
|
||||||
|
if ver_string[ver]=FVersionBranch then
|
||||||
|
begin
|
||||||
|
base:=ver_branch[ver];
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
FViewVCURL:=ViewURL+Base;
|
||||||
|
if Category='1' then
|
||||||
|
FViewVCUrl:=FViewVCURL+TestsSubDir
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
FViewVCUrl:=FViewVCURL+DataBaseSubDir;
|
||||||
// This assumes that type TAnyType is
|
// This assumes that type TAnyType is
|
||||||
// defined in anytype.pas source PM
|
// defined in anytype.pas source PM
|
||||||
if pos('/',FTestFileName)>0 then
|
if pos('/',FTestFileName)>0 then
|
||||||
@ -1397,22 +1844,36 @@ begin
|
|||||||
AntiAliased:=False;
|
AntiAliased:=False;
|
||||||
Resolution:=96;
|
Resolution:=96;
|
||||||
end;
|
end;
|
||||||
// Writeln('Creating image');
|
if FDebug then
|
||||||
|
Writeln(stdout,'Creating image');
|
||||||
Cnv:=TFPImageCanvas.Create(Img);
|
Cnv:=TFPImageCanvas.Create(Img);
|
||||||
// Writeln('Getting width and height');
|
if FDebug then
|
||||||
|
Writeln(stdout,'CNV=0x',hexstr(ptruint(cnv),16));
|
||||||
|
|
||||||
|
if FDebug then
|
||||||
|
Writeln(stdout,'Getting width and height');
|
||||||
W:=Img.Width;
|
W:=Img.Width;
|
||||||
H:=Img.Height;
|
H:=Img.Height;
|
||||||
|
if FDebug then
|
||||||
|
begin
|
||||||
|
Writeln(stdout,'width=',W,' height=',H);
|
||||||
|
//system.flush(stdout);
|
||||||
|
end;
|
||||||
// Writeln('Transparant');
|
// Writeln('Transparant');
|
||||||
cnv.Brush.Style:=bsSolid;
|
cnv.Brush.Style:=bsSolid;
|
||||||
cnv.Brush.FPColor:=colTransparent;
|
cnv.Brush.FPColor:=colTransparent;
|
||||||
cnv.Pen.FPColor:=colWhite;
|
cnv.Pen.FPColor:=colWhite;
|
||||||
Cnv.Rectangle(0,0,W,H);
|
Cnv.Rectangle(0,0,W,H);
|
||||||
// Writeln('Setting font');
|
if FDEbug then
|
||||||
|
Writeln(stdout,'Setting font');
|
||||||
Cnv.Font:=F;
|
Cnv.Font:=F;
|
||||||
// Writeln('Getting textwidth ');
|
if FDebug then
|
||||||
|
Writeln(stdout,'Getting textwidth ');
|
||||||
FH:=CNV.GetTextHeight('A');
|
FH:=CNV.GetTextHeight('A');
|
||||||
If FH=0 then
|
If FH=0 then
|
||||||
FH:=14; // 3 * 14;
|
FH:=14; // 3 * 14;
|
||||||
|
if FDebug then
|
||||||
|
writeln(stdout,'FH=',FH);
|
||||||
Inc(FH,3);
|
Inc(FH,3);
|
||||||
R.Top:=FH*4;
|
R.Top:=FH*4;
|
||||||
R.Left:=0;
|
R.Left:=0;
|
||||||
@ -1423,16 +1884,27 @@ begin
|
|||||||
else
|
else
|
||||||
R.Right:=W;
|
R.Right:=W;
|
||||||
Ra:=CR div 2;
|
Ra:=CR div 2;
|
||||||
// Writeln('Setting pen color');
|
if FDEbug then
|
||||||
|
begin
|
||||||
|
Writeln(stdout,'Setting pen color');
|
||||||
|
system.flush(stdout);
|
||||||
|
end;
|
||||||
Cnv.Pen.FPColor:=colBlack;
|
Cnv.Pen.FPColor:=colBlack;
|
||||||
// Writeln('Palette size : ',Img.Palette.Count);
|
if FDebug then
|
||||||
// Writeln('Setting brush style');
|
begin
|
||||||
|
Writeln(stdout,'Palette size : ',Img.Palette.Count);
|
||||||
|
Writeln(stdout,'Setting brush style');
|
||||||
|
system.flush(stdout);
|
||||||
|
end;
|
||||||
cnv.brush.FPColor:=colRed;
|
cnv.brush.FPColor:=colRed;
|
||||||
// cnv.pen.width:=1;
|
// cnv.pen.width:=1;
|
||||||
// Writeln('Drawing ellipse');
|
// Writeln('Drawing ellipse');
|
||||||
Cnv.Ellipse(R);
|
Cnv.Ellipse(R);
|
||||||
// Writeln('Setting text');
|
if FDebug then
|
||||||
// Writeln('Palette size : ',Img.Palette.Count);
|
begin
|
||||||
|
Writeln(stdout,'Setting text');
|
||||||
|
Writeln(stdout,'Palette size : ',Img.Palette.Count);
|
||||||
|
end;
|
||||||
|
|
||||||
cnv.font.FPColor:=colred;
|
cnv.font.FPColor:=colred;
|
||||||
Inc(FH,4);
|
Inc(FH,4);
|
||||||
|
Loading…
Reference in New Issue
Block a user