Browse Source

Correctly handle log files in root directory (from tests from packages directory)

git-svn-id: trunk@39175 -
pierre 7 years ago
parent
commit
da8dc2b841
1 changed files with 14 additions and 2 deletions
  1. 14 2
      tests/utils/dbdigest.pp

+ 14 - 2
tests/utils/dbdigest.pp

@@ -504,10 +504,16 @@ begin
       exit;
       exit;
     end;
     end;
   FN:=ChangeFileExt(FN,'.log');
   FN:=ChangeFileExt(FN,'.log');
+  { packages tests have ../ replaced by root/ }
+  if not FileExists(FN) and (Copy(FN,1,3)='../') then
+    FN:='root/'+Copy(FN,4,length(FN));
   If FileExists(FN) then
   If FileExists(FN) then
     Result:=GetFileContents(FN)
     Result:=GetFileContents(FN)
   else
   else
-    Result:='';
+    begin
+      Verbose(V_Warning,'File "'+FN+'" not found');
+      Result:='';
+    end;
 end;
 end;
 
 
 Function GetExecuteLog(Line, FN : String) : String;
 Function GetExecuteLog(Line, FN : String) : String;
@@ -519,10 +525,16 @@ begin
       exit;
       exit;
     end;
     end;
   FN:=ChangeFileExt(FN,'.elg');
   FN:=ChangeFileExt(FN,'.elg');
+  { packages tests have ../ replaced by root/ }
+  if not FileExists(FN) and (Copy(FN,1,3)='../') then
+    FN:='root/'+Copy(FN,4,length(FN));
   If FileExists(FN) then
   If FileExists(FN) then
     Result:=GetFileContents(FN)
     Result:=GetFileContents(FN)
   else
   else
-    Result:='';
+    begin
+      Verbose(V_Warning,'File "'+FN+'" not found');
+      Result:='';
+    end;
 end;
 end;
 
 
 Procedure Processfile (FN: String);
 Procedure Processfile (FN: String);