* Added TU_CATEGORY_FK and Svn revs to RunOverview

git-svn-id: trunk@19347 -
This commit is contained in:
pierre 2011-10-03 21:48:53 +00:00
parent 68a8746f8e
commit 732adeaa66

View File

@ -15,12 +15,12 @@ interface
{$undef USE_FPCGI} {$undef USE_FPCGI}
uses uses
{$ifdef USE_FPCGI} {$ifdef USE_FPCGI}
fpcgi, fpcgi,
{$else not USE_FPCGI} {$else not USE_FPCGI}
cgiapp, cgiapp,
{$endif not USE_FPCGI} {$endif not USE_FPCGI}
sysutils,mysql50conn,sqldb,whtml,dbwhtml,db, sysutils,mysql50conn,sqldb,whtml,dbwhtml,db,
tresults, tresults,
Classes,ftFont,fpimage,fpimgcanv,fpWritePng,fpcanvas; Classes,ftFont,fpimage,fpimgcanv,fpWritePng,fpcanvas;
@ -147,7 +147,7 @@ Const
Var Var
SDetailsURL : string; SDetailsURL : string;
type type
known_versions = ( known_versions = (
ver_unknown, ver_unknown,
ver_1_0_10, ver_1_0_10,
@ -208,7 +208,7 @@ const
'2.7.1' '2.7.1'
); );
ver_branch : array [known_versions] of string = ver_branch : array [known_versions] of string =
( (
'', '',
'', '',
@ -252,7 +252,7 @@ begin
2 : CreateRunPie; 2 : CreateRunPie;
3 : ShowOneTest; 3 : ShowOneTest;
4 : ShowHistory; 4 : ShowHistory;
{$ifdef TEST} {$ifdef TEST}
98 : 98 :
begin begin
///EmitOverviewForm; ///EmitOverviewForm;
@ -262,7 +262,7 @@ begin
system.Writeln(stdout,'</PRE>'); system.Writeln(stdout,'</PRE>');
system.Flush(stdout); system.Flush(stdout);
end; end;
99 : 99 :
begin begin
EmitOverviewForm; EmitOverviewForm;
system.Writeln(stdout,'<PRE>'); system.Writeln(stdout,'<PRE>');
@ -273,7 +273,7 @@ begin
{$endif TEST} {$endif TEST}
end; end;
finally finally
EmitEnd; EmitEnd;
DisConnectFromDB; DisConnectFromDB;
end; end;
Finally Finally
@ -306,7 +306,7 @@ begin
FVersion:=RequestVariables['version']; FVersion:=RequestVariables['version'];
if Length(FVersion) = 0 then if Length(FVersion) = 0 then
FVersion:=RequestVariables['TESTVERSION']; FVersion:=RequestVariables['TESTVERSION'];
FOS:=RequestVariables['os']; FOS:=RequestVariables['os'];
if Length(FOS) = 0 then if Length(FOS) = 0 then
FOS:=RequestVariables['TESTOS']; FOS:=RequestVariables['TESTOS'];
@ -614,7 +614,7 @@ begin
EmitInput('testfileid',FTestfileid); EmitInput('testfileid',FTestfileid);
CellEnd; CellEnd;
RowNext; *) RowNext; *)
CellStart; CellStart;
Write('Operating system:'); Write('Operating system:');
CellNext; CellNext;
@ -720,7 +720,7 @@ end;
procedure TTestSuite.EmitEnd; procedure TTestSuite.EmitEnd;
begin begin
if not FNeedEnd then if not FNeedEnd then
exit; exit;
AddResponseLn('</BODY>'); AddResponseLn('</BODY>');
@ -794,6 +794,9 @@ Procedure TTestSuite.ShowRunOverview;
Const Const
SOverview = 'SELECT TU_ID as ID,TU_DATE as Date,TC_NAME as CPU,TO_NAME as OS,'+ SOverview = 'SELECT TU_ID as ID,TU_DATE as Date,TC_NAME as CPU,TO_NAME as OS,'+
'TV_VERSION as Version,COUNT(TR_ID) as Count,'+ 'TV_VERSION as Version,COUNT(TR_ID) as Count,'+
'TU_CATEGORY_FK,TU_SVNCOMPILERREVISION as SvnCompRev,'+
'TU_SVNRTLREVISION as SvnRTLRev,'+
'TU_SVNPACKAGESREVISION as SvnPackRev,TU_SVNTESTSREVISION as SvnTestsRev,'+
'(TU_SUCCESSFULLYFAILED+TU_SUCCESFULLYCOMPILED+TU_SUCCESSFULLYRUN) AS OK,'+ '(TU_SUCCESSFULLYFAILED+TU_SUCCESFULLYCOMPILED+TU_SUCCESSFULLYRUN) AS OK,'+
'(TU_FAILEDTOCOMPILE+TU_FAILEDTORUN+TU_FAILEDTOFAIL) as Failed,'+ '(TU_FAILEDTOCOMPILE+TU_FAILEDTORUN+TU_FAILEDTOFAIL) as Failed,'+
'(TU_SUCCESSFULLYFAILED+TU_SUCCESFULLYCOMPILED+TU_SUCCESSFULLYRUN+'+ '(TU_SUCCESSFULLYFAILED+TU_SUCCESFULLYCOMPILED+TU_SUCCESSFULLYRUN+'+
@ -1023,7 +1026,7 @@ begin
Write('/'+Q2.FieldByName('Total').AsString); Write('/'+Q2.FieldByName('Total').AsString);
end; end;
CellEnd; CellEnd;
RowNext; RowNext;
CellStart; CellStart;
Write('Comment:'); Write('Comment:');
@ -1171,7 +1174,7 @@ begin
+',TR_OK as OK,TR_RESULT as Result' +',TR_OK as OK,TR_RESULT as Result'
+' FROM '+TESTRESULTSTableName(FRunID)+',TESTS' +' FROM '+TESTRESULTSTableName(FRunID)+',TESTS'
+' WHERE (TR_TEST_FK=T_ID) AND (TR_TESTRUN_FK='+FRunID+') '; +' WHERE (TR_TEST_FK=T_ID) AND (TR_TESTRUN_FK='+FRunID+') ';
If FOnlyFailed then If FOnlyFailed then
S:=S+' AND (TR_OK="-")'; S:=S+' AND (TR_OK="-")';
If FNoSkipped then If FNoSkipped then
@ -1271,10 +1274,10 @@ begin
Res:=ShowRunData; Res:=ShowRunData;
Res:=true; Res:=true;
end end
else else
begin begin
// This is useless as it is now // This is useless as it is now
// It should be integrated into a form probably PM // It should be integrated into a form probably PM
Write('Only failed tests'); Write('Only failed tests');
EmitCheckBox('failedonly','1',FonlyFailed); EmitCheckBox('failedonly','1',FonlyFailed);
Write('Hide skipped tests'); Write('Hide skipped tests');
@ -1300,8 +1303,8 @@ begin
begin begin
FieldValue:=Fields[i].AsString; FieldValue:=Fields[i].AsString;
FieldName:=Fields[i].DisplayName; FieldName:=Fields[i].DisplayName;
if (FieldValue<>'') and (FieldValue<>'-') and if (FieldValue<>'') and (FieldValue<>'-') and
(FieldName<>'T_NAME') and (FieldName<>'T_SOURCE') then (FieldName<>'T_NAME') and (FieldName<>'T_SOURCE') then
begin begin
if (FieldValue='+') then if (FieldValue='+') then
@ -1315,14 +1318,14 @@ begin
DumpLn('<BR>'); DumpLn('<BR>');
end; end;
end; end;
Finally Finally
Close; Close;
end; end;
Finally Finally
Free; Free;
end; end;
ParaGraphEnd; ParaGraphEnd;
HeaderStart(2); HeaderStart(2);
Write('Detailed test run results:'); Write('Detailed test run results:');
@ -1398,7 +1401,7 @@ begin
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);
FVersionBranch:=GetVersionName(getsingleton('select TU_VERSION_FK from TESTRUN where TU_ID='+fRunId)); FVersionBranch:=GetVersionName(getsingleton('select TU_VERSION_FK from TESTRUN where TU_ID='+fRunId));
LLog:=''; LLog:='';
Try Try
LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid
+') and (TR_TESTRUN_FK='+frunid+')'); +') and (TR_TESTRUN_FK='+frunid+')');
@ -1418,12 +1421,12 @@ begin
HeaderStart(2); HeaderStart(2);
Write('No log of '+FRunId+'.'); Write('No log of '+FRunId+'.');
HeaderEnd(2); HeaderEnd(2);
end; end;
end; end;
end; end;
if FCompareRunId<>'' then if FCompareRunId<>'' then
begin begin
LLog:=''; LLog:='';
Try Try
LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid
+') and (TR_TESTRUN_FK='+fcomparerunid+')'); +') and (TR_TESTRUN_FK='+fcomparerunid+')');
@ -1443,13 +1446,13 @@ begin
HeaderStart(2); HeaderStart(2);
Write('No log of '+FCompareRunId+'.'); Write('No log of '+FCompareRunId+'.');
HeaderEnd(2); HeaderEnd(2);
end; end;
end; end;
end; end;
if FDebug then if FDebug then
Write('After Log.'); Write('After Log.');
Source:=''; Source:='';
Try Try
Source:=getsingleton('select T_SOURCE from TESTS where T_ID='+ftestfileid); Source:=getsingleton('select T_SOURCE from TESTS where T_ID='+ftestfileid);
if Source<>'' then if Source<>'' then
begin begin
@ -1461,7 +1464,7 @@ begin
system.flush(output); system.flush(output);
PreformatEnd; PreformatEnd;
end; end;
Finally Finally
Base:='trunk'; Base:='trunk';
if FVersionBranch<>'' then if FVersionBranch<>'' then
begin begin
@ -1500,14 +1503,14 @@ begin
'<A HREF="'+FViewVCURL+FTestFileName+'?view=markup'+ '<A HREF="'+FViewVCURL+FTestFileName+'?view=markup'+
'" TARGET="fpc_source"> '+FTestFileName+'</A> source. '); '" TARGET="fpc_source"> '+FTestFileName+'</A> source. ');
HeaderEnd(3); HeaderEnd(3);
end; end;
end; end;
if FDebug then if FDebug then
Write('After Source.'); Write('After Source.');
end end
else else
Write(Format('No data for test file with ID: %s',[FTestFileID])); Write(Format('No data for test file with ID: %s',[FTestFileID]));
end; end;
end; end;
@ -1515,7 +1518,7 @@ end;
Procedure TTestSuite.ShowHistory; Procedure TTestSuite.ShowHistory;
Const Const
MaxCombo = 50; MaxCombo = 50;
Type Type
StatusLongintArray = Array [TTestStatus] of longint; StatusLongintArray = Array [TTestStatus] of longint;
StatusDateTimeArray = Array [TTestStatus] of TDateTime; StatusDateTimeArray = Array [TTestStatus] of TDateTime;
AStatusLA = Array[1..MaxCombo] of StatusLongintArray; AStatusLA = Array[1..MaxCombo] of StatusLongintArray;
@ -1583,10 +1586,10 @@ begin
Res:=ShowRunData; Res:=ShowRunData;
Res:=true; Res:=true;
end end
else else
begin begin
// This is useless as it is now // This is useless as it is now
// It should be integrated into a form probably PM // It should be integrated into a form probably PM
//Write('Only failed tests'); //Write('Only failed tests');
//EmitCheckBox('failedonly','1',FonlyFailed); //EmitCheckBox('failedonly','1',FonlyFailed);
//Write('Hide skipped tests'); //Write('Hide skipped tests');
@ -1612,7 +1615,7 @@ begin
begin begin
FieldValue:=Fields[i].AsString; FieldValue:=Fields[i].AsString;
FieldName:=Fields[i].DisplayName; FieldName:=Fields[i].DisplayName;
if (FieldValue<>'') and (FieldValue<>'-') and if (FieldValue<>'') and (FieldValue<>'-') and
(FieldName<>'T_NAME') and (FieldName<>'T_SOURCE') then (FieldName<>'T_NAME') and (FieldName<>'T_SOURCE') then
begin begin
if (FieldValue='+') then if (FieldValue='+') then
@ -1626,14 +1629,14 @@ begin
DumpLn('<BR>'); DumpLn('<BR>');
end; end;
end; end;
Finally Finally
Close; Close;
end; end;
Finally Finally
Free; Free;
end; end;
ParaGraphEnd; ParaGraphEnd;
HeaderStart(2); HeaderStart(2);
Write('Detailed test run results:'); Write('Detailed test run results:');
end; end;
@ -1753,7 +1756,7 @@ begin
With Q do With Q do
try try
Open; Open;
while not EOF do while not EOF do
Next; Next;
@ -1810,7 +1813,7 @@ begin
run_id:=Fields[run_ind].ASLongint; run_id:=Fields[run_ind].ASLongint;
if (error=0) and (Resi>=longint(FirstStatus)) and if (error=0) and (Resi>=longint(FirstStatus)) and
(Resi<=longint(LastStatus)) then (Resi<=longint(LastStatus)) then
begin begin
TS:=TTestStatus(Resi); TS:=TTestStatus(Resi);
if Result_count[TS]=0 then if Result_count[TS]=0 then
begin begin
@ -1819,7 +1822,7 @@ begin
first_date_id[TS]:=run_id; first_date_id[TS]:=run_id;
last_date_id[TS]:=run_id; last_date_id[TS]:=run_id;
end end
else else
begin begin
if (date>last_date[TS]) then if (date>last_date[TS]) then
begin begin
@ -1832,7 +1835,7 @@ begin
first_date_id[TS]:=run_id; first_date_id[TS]:=run_id;
end; end;
end; end;
inc(Result_count[TS]); inc(Result_count[TS]);
if assigned(cpu_count) and (cpu_id<=cpu_last) then if assigned(cpu_count) and (cpu_id<=cpu_last) then
begin begin
@ -1843,7 +1846,7 @@ begin
cpu_first_date_id^[cpu_id,TS]:=run_id; cpu_first_date_id^[cpu_id,TS]:=run_id;
cpu_last_date_id^[cpu_id,TS]:=run_id; cpu_last_date_id^[cpu_id,TS]:=run_id;
end end
else else
begin begin
if (date>cpu_last_date^[cpu_id,TS]) then if (date>cpu_last_date^[cpu_id,TS]) then
begin begin
@ -1867,7 +1870,7 @@ begin
os_first_date_id^[os_id,TS]:=run_id; os_first_date_id^[os_id,TS]:=run_id;
os_last_date_id^[os_id,TS]:=run_id; os_last_date_id^[os_id,TS]:=run_id;
end end
else else
begin begin
if (date>os_last_date^[os_id,TS]) then if (date>os_last_date^[os_id,TS]) then
begin begin
@ -1891,7 +1894,7 @@ begin
version_first_date_id^[version_id,TS]:=run_id; version_first_date_id^[version_id,TS]:=run_id;
version_last_date_id^[version_id,TS]:=run_id; version_last_date_id^[version_id,TS]:=run_id;
end end
else else
begin begin
if (date>version_last_date^[version_id,TS]) then if (date>version_last_date^[version_id,TS]) then
begin begin
@ -2085,7 +2088,7 @@ begin
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);
FVersionBranch:=GetVersionName(getsingleton('select TU_VERSION_FK from TESTRUN where TU_ID='+fRunId)); FVersionBranch:=GetVersionName(getsingleton('select TU_VERSION_FK from TESTRUN where TU_ID='+fRunId));
LLog:=''; LLog:='';
Try Try
LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid
+') and (TR_TESTRUN_FK='+frunid+')'); +') and (TR_TESTRUN_FK='+frunid+')');
@ -2105,12 +2108,12 @@ begin
HeaderStart(2); HeaderStart(2);
Write('No log of '+FRunId+'.'); Write('No log of '+FRunId+'.');
HeaderEnd(2); HeaderEnd(2);
end; end;
end; end;
end; end;
if FCompareRunId<>'' then if FCompareRunId<>'' then
begin begin
LLog:=''; LLog:='';
Try Try
LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid LLog:=getsingleton('select TR_LOG from TESTRESULTS where (TR_TEST_FK='+ftestfileid
+') and (TR_TESTRUN_FK='+fcomparerunid+')'); +') and (TR_TESTRUN_FK='+fcomparerunid+')');
@ -2130,13 +2133,13 @@ begin
HeaderStart(2); HeaderStart(2);
Write('No log of '+FCompareRunId+'.'); Write('No log of '+FCompareRunId+'.');
HeaderEnd(2); HeaderEnd(2);
end; end;
end; end;
end; end;
if FDebug then if FDebug then
Write('After log.'); Write('After log.');
Source:=''; Source:='';
Try Try
Source:=getsingleton('select T_SOURCE from TESTS where T_ID='+ftestfileid); Source:=getsingleton('select T_SOURCE from TESTS where T_ID='+ftestfileid);
if Source<>'' then if Source<>'' then
begin begin
@ -2148,7 +2151,7 @@ begin
system.flush(output); system.flush(output);
PreformatEnd; PreformatEnd;
end; end;
Finally Finally
Base:='trunk'; Base:='trunk';
if FVersionBranch<>'' then if FVersionBranch<>'' then
begin begin
@ -2187,14 +2190,14 @@ begin
'<A HREF="'+FViewVCURL+FTestFileName+'?view=markup'+ '<A HREF="'+FViewVCURL+FTestFileName+'?view=markup'+
'" TARGET="fpc_source"> '+FTestFileName+'</A> source. '); '" TARGET="fpc_source"> '+FTestFileName+'</A> source. ');
HeaderEnd(3); HeaderEnd(3);
end; end;
end; end;
if FDebug then if FDebug then
Write('After Source.'); Write('After Source.');
end end
else else
Write(Format('No data for test file with ID: %s',[FTestFileID])); Write(Format('No data for test file with ID: %s',[FTestFileID]));
end; end;
if assigned(os_count) then if assigned(os_count) then
begin begin
@ -2388,7 +2391,7 @@ begin
BGColor:='#68DFB8' BGColor:='#68DFB8'
else if Run1Field.ASString<>'+' then else if Run1Field.ASString<>'+' then
BGColor:='#98FB98'; // pale Green BGColor:='#98FB98'; // pale Green
end end
else if Run2Field.AsString='-' then else if Run2Field.AsString='-' then
begin begin
Inc(FRunFailedCount); Inc(FRunFailedCount);
@ -2453,7 +2456,7 @@ begin
if FVersion<>'' then if FVersion<>'' then
S:=Format(TestSuiteCGIURL + '?action=4&version=%s&testfileid=%s', S:=Format(TestSuiteCGIURL + '?action=4&version=%s&testfileid=%s',
[FVersion,P.DataSet.FieldByName('Id').AsString]) [FVersion,P.DataSet.FieldByName('Id').AsString])
else else
S:=Format(TestSuiteCGIURL + '?action=4&testfileid=%s', S:=Format(TestSuiteCGIURL + '?action=4&testfileid=%s',
[P.DataSet.FieldByName('Id').AsString]); [P.DataSet.FieldByName('Id').AsString]);
CellData:=Format('<A HREF="%s">%s</A>',[S,CellData]); CellData:=Format('<A HREF="%s">%s</A>',[S,CellData]);
@ -2471,7 +2474,7 @@ begin
if FCompareRunID<>'' then if FCompareRunID<>'' then
S:=Format(TestSuiteCGIURL + '?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(TestSuiteCGIURL + '?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]);
@ -2487,7 +2490,7 @@ begin
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
begin begin
TS:=TTestStatus(Res); TS:=TTestStatus(Res);
CellData:=StatusText[TS]; CellData:=StatusText[TS];
end; end;