瀏覽代碼

* support TestSrcDir option, where the *.pp files can be found

git-svn-id: trunk@149 -
fpc 20 年之前
父節點
當前提交
70fbf3bf17
共有 2 個文件被更改,包括 16 次插入4 次删除
  1. 11 3
      tests/utils/dbdigest.pp
  2. 5 1
      tests/utils/dbtests.pp

+ 11 - 3
tests/utils/dbdigest.pp

@@ -198,7 +198,8 @@ TConfigOpt = (
   coDate,
   coSubmitter,
   coMachine,
-  coComment
+  coComment,
+  coTestSrcDir
  );
 
 Const
@@ -215,11 +216,12 @@ ConfigStrings : Array [TConfigOpt] of string = (
   'date',
   'submitter',
   'machine',
-  'comment'
+  'comment',
+  'testsrcdir'
 );
 
 ConfigOpts : Array[TConfigOpt] of char
-           = ('d','h','u','p','l','o','c','v','t','s','m','C');
+           = ('d','h','u','p','l','o','c','v','t','s','m','C','S');
 
 Var
   TestOS,
@@ -251,6 +253,12 @@ begin
     coSubmitter    : Submitter:=Value;
     coMachine      : Machine:=Value;
     coComment      : Comment:=Value;
+    coTestSrcDir   :
+      begin
+        TestSrcDir:=Value;
+	if (TestSrcDir<>'') and (TestSrcDir[length(TestSrcDir)]<>'/') then
+	  TestSrcDir:=TestSrcDir+'/';
+      end;	  
   end;
 end;
 

+ 5 - 1
tests/utils/dbtests.pp

@@ -48,6 +48,9 @@ Function  IDQuery(Qry : String) : Integer;
 Function  EscapeSQL( S : String) : String;
 Function SQLDate(D : TDateTime) : String;
 
+var
+  TestSrcDir : string;
+  
 Implementation
 
 Uses
@@ -257,7 +260,8 @@ Var
 
 begin
   Result:=-1;
-  If FileExists(Name) and GetConfig(Name,Info) then
+  If FileExists(TestSrcDir+Name) and
+     GetConfig(TestSrcDir+Name,Info) then
     begin
     If RunQuery(Format(SInsertTest,[ExtractFileName(Name),Name]),Res) then
       begin