mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-10 00:55:58 +02:00
* Try to handle mixed separation/output lines
This commit is contained in:
parent
e7ae1f9152
commit
b40450d687
@ -46,7 +46,7 @@ Type
|
|||||||
// Update the test run statistics.
|
// Update the test run statistics.
|
||||||
procedure UpdateTestRun(const aData: TTestRunData);
|
procedure UpdateTestRun(const aData: TTestRunData);
|
||||||
// Get contents from longlog
|
// Get contents from longlog
|
||||||
function GetContentsFromLongLog(Line: String): String;
|
function GetContentsFromLongLog(Line: String; out IsFOund : Boolean): String;
|
||||||
// Get Log from file line
|
// Get Log from file line
|
||||||
function GetLog(Line, FN: String): String;
|
function GetLog(Line, FN: String): String;
|
||||||
public
|
public
|
||||||
@ -173,7 +173,7 @@ end;
|
|||||||
const
|
const
|
||||||
SeparationLine = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
|
SeparationLine = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
|
||||||
|
|
||||||
function TDBDigestAnalyzer.GetContentsFromLongLog(Line: String): String;
|
function TDBDigestAnalyzer.GetContentsFromLongLog(Line: String; out IsFOund : Boolean): String;
|
||||||
|
|
||||||
Function GetLongLogLine : String;
|
Function GetLongLogLine : String;
|
||||||
begin
|
begin
|
||||||
@ -188,11 +188,12 @@ function TDBDigestAnalyzer.GetContentsFromLongLog(Line: String): String;
|
|||||||
|
|
||||||
var
|
var
|
||||||
S : String;
|
S : String;
|
||||||
IsFirst, IsFound : boolean;
|
IsFirst : boolean;
|
||||||
InternalErrorPos : Integer;
|
InternalErrorPos : Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:='';
|
Result:='';
|
||||||
|
IsFound:=False;
|
||||||
{ The "internalerror generated" message is not present in compilation log }
|
{ The "internalerror generated" message is not present in compilation log }
|
||||||
InternalErrorPos:=pos(' internalerror generated',Line);
|
InternalErrorPos:=pos(' internalerror generated',Line);
|
||||||
if (InternalErrorPos>0) then
|
if (InternalErrorPos>0) then
|
||||||
@ -209,7 +210,7 @@ begin
|
|||||||
if (pos(Line,S)=0) and (pos(SeparationLine,S)>=1) then
|
if (pos(Line,S)=0) and (pos(SeparationLine,S)>=1) then
|
||||||
S:=GetLongLogLine
|
S:=GetLongLogLine
|
||||||
end;
|
end;
|
||||||
if pos(Line,S)=1 then
|
if pos(Line,S)>=1 then
|
||||||
begin
|
begin
|
||||||
IsFound:=true;
|
IsFound:=true;
|
||||||
while HaveLongLogLine do
|
while HaveLongLogLine do
|
||||||
@ -217,7 +218,16 @@ begin
|
|||||||
S:=GetLongLogLine;
|
S:=GetLongLogLine;
|
||||||
{ End of file marker }
|
{ End of file marker }
|
||||||
if (Not HaveLongLogLine) or (pos(SeparationLine,S)=1) then
|
if (Not HaveLongLogLine) or (pos(SeparationLine,S)=1) then
|
||||||
|
begin
|
||||||
|
{ Do not skip separation line, if it also contains something else }
|
||||||
|
if HaveLongLogLine and (S<>SeparationLine) and (FCurlonglogline>0) then
|
||||||
|
begin
|
||||||
|
Verbose(V_Warning,'Line "'+S+'" is not a pure separation line');
|
||||||
|
Dec(FCurlonglogline);
|
||||||
|
end;
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
if length(Result)<MaxLogSize then
|
if length(Result)<MaxLogSize then
|
||||||
Result:=Result+S+LineEnding;
|
Result:=Result+S+LineEnding;
|
||||||
if pos(SeparationLine,S)>1 then
|
if pos(SeparationLine,S)>1 then
|
||||||
@ -232,7 +242,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if not IsFound then
|
if not IsFound then
|
||||||
begin
|
begin
|
||||||
Verbose(V_Warning,'Line "'+Line+'" not found');
|
Verbose(V_Warning,'Line "'+Line+'" not found. Starting over');
|
||||||
FCurlongLogLine:=0; // Reset
|
FCurlongLogLine:=0; // Reset
|
||||||
Inc(FLongLogRestartCount);
|
Inc(FLongLogRestartCount);
|
||||||
end;
|
end;
|
||||||
@ -240,10 +250,15 @@ end;
|
|||||||
|
|
||||||
function TDBDigestAnalyzer.GetLog(Line, FN: String): String;
|
function TDBDigestAnalyzer.GetLog(Line, FN: String): String;
|
||||||
|
|
||||||
|
var
|
||||||
|
IsFound : boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if UseLongLog then
|
if UseLongLog then
|
||||||
begin
|
begin
|
||||||
Result:=GetContentsFromLongLog(Line);
|
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||||
|
if not IsFound then
|
||||||
|
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
FN:=ChangeFileExt(FN,'.log');
|
FN:=ChangeFileExt(FN,'.log');
|
||||||
@ -261,10 +276,15 @@ end;
|
|||||||
|
|
||||||
function TDBDigestAnalyzer.GetExecuteLog(Line, FN: String): String;
|
function TDBDigestAnalyzer.GetExecuteLog(Line, FN: String): String;
|
||||||
|
|
||||||
|
var
|
||||||
|
IsFound : Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if UseLongLog then
|
if UseLongLog then
|
||||||
begin
|
begin
|
||||||
Result:=GetContentsFromLongLog(Line);
|
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||||
|
if not IsFound then
|
||||||
|
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
FN:=ChangeFileExt(FN,'.elg');
|
FN:=ChangeFileExt(FN,'.elg');
|
||||||
|
Loading…
Reference in New Issue
Block a user