mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 13:21:35 +02:00
* Add some additional fields to testrun table
git-svn-id: trunk@14777 -
This commit is contained in:
parent
be36d13e73
commit
def7ffbea5
@ -80,6 +80,17 @@ TConfigOpt = (
|
|||||||
coVerbose
|
coVerbose
|
||||||
);
|
);
|
||||||
|
|
||||||
|
{ Additional options only for dbdigest.cfg file }
|
||||||
|
|
||||||
|
TConfigAddOpt = (
|
||||||
|
coCompilerDate,
|
||||||
|
coCompilerFullVersion,
|
||||||
|
coSvnCompilerRevision,
|
||||||
|
coSvnTestsRevision,
|
||||||
|
coSvnRTLRevision,
|
||||||
|
coSvnPackagesRevision
|
||||||
|
);
|
||||||
|
|
||||||
Const
|
Const
|
||||||
|
|
||||||
ConfigStrings : Array [TConfigOpt] of string = (
|
ConfigStrings : Array [TConfigOpt] of string = (
|
||||||
@ -102,6 +113,24 @@ ConfigStrings : Array [TConfigOpt] of string = (
|
|||||||
'verbose'
|
'verbose'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ConfigAddStrings : Array [TConfigAddOpt] of string = (
|
||||||
|
'compilerdate',
|
||||||
|
'compilerfullversion',
|
||||||
|
'svncompilerrevision',
|
||||||
|
'svntestsrevision',
|
||||||
|
'svntlrevision',
|
||||||
|
'svnpackagesrevision'
|
||||||
|
);
|
||||||
|
|
||||||
|
ConfigAddCols : Array [TConfigAddOpt] of string = (
|
||||||
|
'TU_COMPILERDATE',
|
||||||
|
'TU_COMPILERFULLVERSION',
|
||||||
|
'TU_SVNCOMPILERREVIVISION',
|
||||||
|
'TU_SVNTESTSREVISION',
|
||||||
|
'TU_SVNRTLREVISION',
|
||||||
|
'TU_SVNPACKAGESREVISION'
|
||||||
|
);
|
||||||
|
|
||||||
ConfigOpts : Array[TConfigOpt] of char
|
ConfigOpts : Array[TConfigOpt] of char
|
||||||
= ('d','h','u','p','P','l','o','c','a','v','t','s','m','C','S','r','V');
|
= ('d','h','u','p','P','l','o','c','a','v','t','s','m','C','S','r','V');
|
||||||
|
|
||||||
@ -120,6 +149,30 @@ Var
|
|||||||
Machine,
|
Machine,
|
||||||
Comment : String;
|
Comment : String;
|
||||||
TestDate : TDateTime;
|
TestDate : TDateTime;
|
||||||
|
TestCompilerDate,
|
||||||
|
TestCompilerFullVersion,
|
||||||
|
TestSvnCompilerRevision,
|
||||||
|
TestSvnTestsRevision,
|
||||||
|
TestSvnRTLRevision,
|
||||||
|
TestSvnPackagesRevision : String;
|
||||||
|
|
||||||
|
Procedure SetAddOpt (O : TConfigAddOpt; Value : string);
|
||||||
|
begin
|
||||||
|
Case O of
|
||||||
|
coCompilerDate:
|
||||||
|
TestCompilerDate:=Value;
|
||||||
|
coCompilerFullVersion:
|
||||||
|
TestCompilerFullVersion:=Value;
|
||||||
|
coSvnCompilerRevision:
|
||||||
|
TestSvnCompilerRevision:=Value;
|
||||||
|
coSvnTestsRevision:
|
||||||
|
TestSvnTestsRevision:=Value;
|
||||||
|
coSvnRTLRevision:
|
||||||
|
TestSvnRTLRevision:=Value;
|
||||||
|
coSvnPackagesRevision:
|
||||||
|
TestSvnPackagesRevision:=Value;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure SetOpt (O : TConfigOpt; Value : string);
|
Procedure SetOpt (O : TConfigOpt; Value : string);
|
||||||
var
|
var
|
||||||
@ -178,6 +231,7 @@ Var
|
|||||||
N : String;
|
N : String;
|
||||||
I : Integer;
|
I : Integer;
|
||||||
co : TConfigOpt;
|
co : TConfigOpt;
|
||||||
|
coa : TConfigAddOpt;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Verbose(V_DEBUG,'Processing option: '+S);
|
Verbose(V_DEBUG,'Processing option: '+S);
|
||||||
@ -191,13 +245,22 @@ begin
|
|||||||
begin
|
begin
|
||||||
Result:=CompareText(ConfigStrings[co],N)=0;
|
Result:=CompareText(ConfigStrings[co],N)=0;
|
||||||
If Result then
|
If Result then
|
||||||
Break;
|
begin
|
||||||
|
SetOpt(co,S);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
For coa:=low(TConfigAddOpt) to high(TConfigAddOpt) do
|
||||||
|
begin
|
||||||
|
Result:=CompareText(ConfigAddStrings[coa],N)=0;
|
||||||
|
If Result then
|
||||||
|
begin
|
||||||
|
SetAddOpt(coa,S);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
If Result then
|
Verbose(V_ERROR,'Unknown option : '+n+S);
|
||||||
SetOpt(co,S)
|
|
||||||
else
|
|
||||||
Verbose(V_ERROR,'Unknown option : '+n+S);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure ProcessConfigfile(FN : String);
|
Procedure ProcessConfigfile(FN : String);
|
||||||
@ -390,6 +453,19 @@ procedure UpdateTestRun;
|
|||||||
qry:='UPDATE TESTRUN SET ';
|
qry:='UPDATE TESTRUN SET ';
|
||||||
for i:=low(TTestStatus) to high(TTestStatus) do
|
for i:=low(TTestStatus) to high(TTestStatus) do
|
||||||
qry:=qry+format('%s=%d, ',[SQLField[i],StatusCount[i]]);
|
qry:=qry+format('%s=%d, ',[SQLField[i],StatusCount[i]]);
|
||||||
|
if TestCompilerDate<>'' then
|
||||||
|
qry:=qry+format('%s="%s", ',[ConfigAddCols[coCompilerDate],EscapeSQL(TestCompilerDate)]);
|
||||||
|
if TestCompilerFullVersion<>'' then
|
||||||
|
qry:=qry+format('%s="%s", ',[ConfigAddCols[coCompilerFullVersion],EscapeSQL(TestCompilerFullVersion)]);
|
||||||
|
if TestSvnCompilerRevision<>'' then
|
||||||
|
qry:=qry+format('%s="%s", ',[ConfigAddCols[coSvnCompilerRevision],EscapeSQL(TestSvnCompilerRevision)]);
|
||||||
|
if TestSvnTestsRevision<>'' then
|
||||||
|
qry:=qry+format('%s="%s", ',[ConfigAddCols[coSvnTestsRevision],EscapeSQL(TestSvnTestsRevision)]);
|
||||||
|
if TestSvnRTLRevision<>'' then
|
||||||
|
qry:=qry+format('%s="%s", ',[ConfigAddCols[coSvnRTLRevision],EscapeSQL(TestSvnRTLRevision)]);
|
||||||
|
if TestSvnPackagesRevision<>'' then
|
||||||
|
qry:=qry+format('%s="%s", ',[ConfigAddCols[coSvnPackagesRevision],EscapeSQL(TestSvnPackagesRevision)]);
|
||||||
|
|
||||||
qry:=qry+format('TU_SUBMITTER="%s", TU_MACHINE="%s", TU_COMMENT="%s", TU_DATE="%s"',[Submitter,Machine,Comment,SqlDate(TestDate)]);
|
qry:=qry+format('TU_SUBMITTER="%s", TU_MACHINE="%s", TU_COMMENT="%s", TU_DATE="%s"',[Submitter,Machine,Comment,SqlDate(TestDate)]);
|
||||||
qry:=qry+' WHERE TU_ID='+format('%d',[TestRunID]);
|
qry:=qry+' WHERE TU_ID='+format('%d',[TestRunID]);
|
||||||
RunQuery(Qry,res)
|
RunQuery(Qry,res)
|
||||||
|
Loading…
Reference in New Issue
Block a user