mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 16:29:21 +02:00
* only output end if start is already written, prevents wrong html
git-svn-id: trunk@9532 -
This commit is contained in:
parent
fed5137bbb
commit
9a70cf8e16
@ -9,11 +9,8 @@ uses cgiapp,sysutils,mysql41conn,sqldb,whtml,dbwhtml,db,
|
|||||||
Classes,ftFont,fpimage,fpimgcanv,fpWritePng,fpcanvas;
|
Classes,ftFont,fpimage,fpimgcanv,fpWritePng,fpcanvas;
|
||||||
|
|
||||||
const
|
const
|
||||||
{$ifndef TEST}
|
TestsuiteURLPrefix='http://www.freepascal.org/testsuite/';
|
||||||
CGI = 'testsuite.cgi';
|
TestsuiteCGIURL = TestsuiteURLPrefix+'cgi-bin/testsuite.cgi';
|
||||||
{$else TEST}
|
|
||||||
CGI = 'testsuite-new.cgi';
|
|
||||||
{$endif TEST}
|
|
||||||
ViewVCURL='http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/tests/';
|
ViewVCURL='http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/tests/';
|
||||||
|
|
||||||
Type
|
Type
|
||||||
@ -40,6 +37,7 @@ Type
|
|||||||
FAction,
|
FAction,
|
||||||
FLimit : Integer;
|
FLimit : Integer;
|
||||||
FTestLastDays : Integer;
|
FTestLastDays : Integer;
|
||||||
|
FNeedEnd : boolean;
|
||||||
Procedure GetOverviewRowAttr(Sender : TObject; Var BGColor : String;
|
Procedure GetOverviewRowAttr(Sender : TObject; Var BGColor : String;
|
||||||
Var Align : THTMLAlign; Var VAlign : THTMLValign;
|
Var Align : THTMLAlign; Var VAlign : THTMLValign;
|
||||||
Var CustomAttr : String) ;
|
Var CustomAttr : String) ;
|
||||||
@ -92,7 +90,7 @@ Const
|
|||||||
}
|
}
|
||||||
|
|
||||||
Const
|
Const
|
||||||
SDetailsURL = CGI + '?action=1&run1id=%s';
|
SDetailsURL = TestsuiteCGIURL + '?action=1&run1id=%s';
|
||||||
|
|
||||||
Procedure TTestSuite.DoRun;
|
Procedure TTestSuite.DoRun;
|
||||||
|
|
||||||
@ -294,6 +292,7 @@ begin
|
|||||||
AddResponseLn('<HTML>');
|
AddResponseLn('<HTML>');
|
||||||
AddResponseLn('<TITLE>'+ATitle+'</TITLE>');
|
AddResponseLn('<TITLE>'+ATitle+'</TITLE>');
|
||||||
AddResponseLn('<BODY>');
|
AddResponseLn('<BODY>');
|
||||||
|
FNeedEnd:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TTestSuite.EmitOverviewForm;
|
Procedure TTestSuite.EmitOverviewForm;
|
||||||
@ -310,7 +309,7 @@ begin
|
|||||||
HeaderEnd(1);
|
HeaderEnd(1);
|
||||||
Write('Please specify search criteria:');
|
Write('Please specify search criteria:');
|
||||||
ParagraphStart;
|
ParagraphStart;
|
||||||
FormStart(CGI,'');
|
FormStart(TestsuiteCGIURL,'');
|
||||||
TableStart(2,true);
|
TableStart(2,true);
|
||||||
RowStart;
|
RowStart;
|
||||||
CellStart;
|
CellStart;
|
||||||
@ -363,6 +362,8 @@ end;
|
|||||||
|
|
||||||
procedure TTestSuite.EmitEnd;
|
procedure TTestSuite.EmitEnd;
|
||||||
begin
|
begin
|
||||||
|
if not FNeedEnd then
|
||||||
|
exit;
|
||||||
AddResponseLn('</BODY>');
|
AddResponseLn('</BODY>');
|
||||||
AddResponseLn('</HTML>');
|
AddResponseLn('</HTML>');
|
||||||
end;
|
end;
|
||||||
@ -562,7 +563,7 @@ begin
|
|||||||
If Result then
|
If Result then
|
||||||
With FHTMLWriter do
|
With FHTMLWriter do
|
||||||
begin
|
begin
|
||||||
FormStart(CGI,'get');
|
FormStart(TestsuiteCGIURL,'get');
|
||||||
EmitHiddenVar('action', '1');
|
EmitHiddenVar('action', '1');
|
||||||
TableStart(3,true);
|
TableStart(3,true);
|
||||||
RowStart;
|
RowStart;
|
||||||
@ -773,7 +774,7 @@ begin
|
|||||||
If Not (FRunCount=0) and not (FNoSkipped or FOnlyFailed) then
|
If Not (FRunCount=0) and not (FNoSkipped or FOnlyFailed) then
|
||||||
begin
|
begin
|
||||||
ParaGraphStart;
|
ParaGraphStart;
|
||||||
TagStart('IMG',Format('Src="'+CGI+'?action=2&pietotal=%d&piefailed=%d&pieskipped=%d"',[FRunCount,FRunFailedCount,FRunSkipCount]));
|
TagStart('IMG',Format('Src="'+TestsuiteCGIURL+'?action=2&pietotal=%d&piefailed=%d&pieskipped=%d"',[FRunCount,FRunFailedCount,FRunSkipCount]));
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -789,7 +790,7 @@ Var
|
|||||||
Q : TSQLQuery;
|
Q : TSQLQuery;
|
||||||
i : longint;
|
i : longint;
|
||||||
FieldName,FieldValue,
|
FieldName,FieldValue,
|
||||||
Log,Comment,Source : String;
|
Log,Source : String;
|
||||||
Res : Boolean;
|
Res : Boolean;
|
||||||
begin
|
begin
|
||||||
ConnectToDB;
|
ConnectToDB;
|
||||||
@ -1128,7 +1129,7 @@ begin
|
|||||||
If Not (FRunCount=0) and not (FNoSkipped or FOnlyFailed) then
|
If Not (FRunCount=0) and not (FNoSkipped or FOnlyFailed) then
|
||||||
begin
|
begin
|
||||||
ParaGraphStart;
|
ParaGraphStart;
|
||||||
TagStart('IMG',Format('Src="'+CGI+'?action=2&pietotal=%d&piefailed=%d&pieskipped=%d"',[FRunCount,FRunFailedCount,FRunSkipCount]));
|
TagStart('IMG',Format('Src="'+TestsuiteCGIURL+'?action=2&pietotal=%d&piefailed=%d&pieskipped=%d"',[FRunCount,FRunFailedCount,FRunSkipCount]));
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1228,10 +1229,10 @@ Var
|
|||||||
begin
|
begin
|
||||||
P:=(Sender as TTableProducer);
|
P:=(Sender as TTableProducer);
|
||||||
if FCompareRunID<>'' then
|
if FCompareRunID<>'' then
|
||||||
S:=Format(CGI + '?action=3&run1id=%s&run2id=%s&testfileid=%s',
|
S:=Format(TestSuiteCGIURL + '?action=3&run1id=%s&run2id=%s&testfileid=%s',
|
||||||
[FRunID,FCompareRunID,P.DataSet.FieldByName('Id').AsString])
|
[FRunID,FCompareRunID,P.DataSet.FieldByName('Id').AsString])
|
||||||
else
|
else
|
||||||
S:=Format(CGI + '?action=3&run1id=%s&testfileid=%s',
|
S:=Format(TestSuiteCGIURL + '?action=3&run1id=%s&testfileid=%s',
|
||||||
[FRunID,P.DataSet.FieldByName('Id').AsString]);
|
[FRunID,P.DataSet.FieldByName('Id').AsString]);
|
||||||
CellData:=Format('<A HREF="%s">%s</A>',[S,CellData]);
|
CellData:=Format('<A HREF="%s">%s</A>',[S,CellData]);
|
||||||
end;
|
end;
|
||||||
@ -1242,9 +1243,7 @@ Var
|
|||||||
Res : longint;
|
Res : longint;
|
||||||
Error:word;
|
Error:word;
|
||||||
TS : TTestStatus;
|
TS : TTestStatus;
|
||||||
P : TTableProducer;
|
|
||||||
begin
|
begin
|
||||||
P:=(Sender as TTableProducer);
|
|
||||||
Val(CellData,Res,Error);
|
Val(CellData,Res,Error);
|
||||||
if (Error=0) and (Res>=longint(FirstStatus)) and
|
if (Error=0) and (Res>=longint(FirstStatus)) and
|
||||||
(Res<=longint(LastStatus)) then
|
(Res<=longint(LastStatus)) then
|
||||||
|
Loading…
Reference in New Issue
Block a user