mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-05 22:50:18 +02:00
* Fixes after tests with foreign keys enabled
This commit is contained in:
parent
762d1d2f1e
commit
6da401b1c3
@ -243,9 +243,9 @@ begin
|
||||
'S','testsrcdir': aConfig.testsrcdir:=aValue;
|
||||
'r','relsrcdir': aConfig.relsrcdir:=aValue;
|
||||
'V','verbose': DoVerbose:=True;
|
||||
'sql': dosql:=true;
|
||||
'T','threadlist' : ; // treated elsewhere
|
||||
'j','threadcount' : ; // treated elsewhere
|
||||
// 'S','sql': aConfig.sql:=aValue;
|
||||
'compilerdate': aData.CompilerDate:=aValue;
|
||||
'compilerfullversion': aData.CompilerFullVersion:=aValue;
|
||||
'svncompilerrevision': aData.CompilerRevision:=aValue;
|
||||
@ -376,7 +376,11 @@ function TDBDigestApplication.ProcessCommandLine(var aConfig: TDigestConfig; var
|
||||
Result:=['help'];
|
||||
SetLength(Result,1+Length(S));
|
||||
For I:=0 to Length(S)-1 do
|
||||
Result[1+i]:=S[I]+':'
|
||||
begin
|
||||
Result[1+I]:=S[I];
|
||||
if (S[I]<>'verbose') and (S[I]<>'sql') then
|
||||
Result[1+I]:=Result[1+I]+':';
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
|
@ -116,6 +116,8 @@ begin
|
||||
aData.CPUID := FDB.GetCPUID(aData.CPU);
|
||||
aData.OSID := FDB.GetOSID(aData.OS);
|
||||
aData.VersionID := FDB.GetVersionID(aData.Version);
|
||||
if aData.Category='' then
|
||||
aData.Category:='Compiler/RTL';
|
||||
aData.CategoryID := FDB.GetCategoryID(aData.Category);
|
||||
aData.PlatformID := FDB.GetPlatformID(aData,True);
|
||||
If (Round(aData.Date)=0) then
|
||||
@ -127,14 +129,12 @@ begin
|
||||
If (aData.RunID<>-1) then
|
||||
FDB.CleanTestRun(aData.RunID)
|
||||
else
|
||||
begin
|
||||
aData.RunID:=FDB.AddRun(aData);
|
||||
Result:=aData.RunID<>-1;
|
||||
if not Result then
|
||||
begin
|
||||
Verbose(V_Error,'Could not insert new testrun record!');
|
||||
exit;
|
||||
end;
|
||||
Result:=aData.RunID<>-1;
|
||||
if not Result then
|
||||
begin
|
||||
Verbose(V_Error,'Could not insert new testrun record!');
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -332,6 +332,7 @@ var
|
||||
|
||||
begin
|
||||
lPrev:=Default(TTestResultData);
|
||||
lResult:=Default(TTestResultData);
|
||||
// init data common to the whole testrun
|
||||
lResult.RunID:=aData.RunID;
|
||||
lResult.PlatFormID:=aData.PlatFormID;
|
||||
@ -349,7 +350,6 @@ begin
|
||||
LogFile.LoadFromFile(aFileName);
|
||||
For FullLine in LogFile do
|
||||
begin
|
||||
lResult:=Default(TTestResultData);
|
||||
line:=fullline;
|
||||
TS:=stFailedToCompile;
|
||||
lResult.TestResult:=TS;
|
||||
|
@ -9,8 +9,11 @@ CREATE DATABASE testsuite
|
||||
LC_COLLATE = 'en_GB.UTF-8'
|
||||
LC_CTYPE = 'en_GB.UTF-8'
|
||||
TABLESPACE = pg_default
|
||||
template = 'template0'
|
||||
CONNECTION LIMIT = -1
|
||||
IS_TEMPLATE = False;
|
||||
|
||||
\c testsuite
|
||||
|
||||
CREATE SEQUENCE SEQ_TESTCATEGORY as INT start with 1;
|
||||
|
||||
@ -162,6 +165,18 @@ CREATE TABLE TESTPREVIOUSRESULTS (
|
||||
|
||||
CREATE UNIQUE INDEX UDX_TESTPREVIOUSRESULTS ON TESTPREVIOUSRESULTS(TPR_PLATFORM_FK,TPR_TEST_FK);
|
||||
|
||||
-- Create relations
|
||||
|
||||
ALTER TABLE testplatform ADD CONSTRAINT fk_plaform_os FOREIGN KEY (tp_os_fk) REFERENCES testos (to_id);
|
||||
ALTER TABLE testplatform ADD CONSTRAINT fk_plaform_cpu FOREIGN KEY (tp_cpu_fk) REFERENCES testcpu (tc_id);
|
||||
ALTER TABLE testplatform ADD CONSTRAINT fk_plaform_version FOREIGN KEY (tp_version_fk) REFERENCES testversion (tv_id);
|
||||
ALTER TABLE testplatform ADD CONSTRAINT fk_plaform_category FOREIGN KEY (tp_category_fk) REFERENCES testcategory (ta_id);
|
||||
ALTER TABLE testrun ADD CONSTRAINT fk_run_platform FOREIGN KEY (tu_platform_fk) REFERENCES testplatform (tp_id);
|
||||
ALTER TABLE testresults ADD CONSTRAINT fk_results_run FOREIGN KEY (tr_testrun_fk) REFERENCES testrun (tu_id);
|
||||
ALTER TABLE testresults ADD CONSTRAINT fk_results_test FOREIGN KEY (tr_test_fk) REFERENCES tests (t_id);
|
||||
|
||||
-- Insert default data
|
||||
|
||||
INSERT INTO TESTCATEGORY VALUES (1, 'Compiler/RTL');
|
||||
INSERT INTO TESTCATEGORY VALUES (2, 'DB');
|
||||
ALTER SEQUENCE SEQ_TESTCATEGORY RESTART WITH 3;
|
||||
|
Loading…
Reference in New Issue
Block a user