mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 23:31:49 +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.
|
||||
procedure UpdateTestRun(const aData: TTestRunData);
|
||||
// Get contents from longlog
|
||||
function GetContentsFromLongLog(Line: String): String;
|
||||
function GetContentsFromLongLog(Line: String; out IsFOund : Boolean): String;
|
||||
// Get Log from file line
|
||||
function GetLog(Line, FN: String): String;
|
||||
public
|
||||
@ -173,7 +173,7 @@ end;
|
||||
const
|
||||
SeparationLine = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
|
||||
|
||||
function TDBDigestAnalyzer.GetContentsFromLongLog(Line: String): String;
|
||||
function TDBDigestAnalyzer.GetContentsFromLongLog(Line: String; out IsFOund : Boolean): String;
|
||||
|
||||
Function GetLongLogLine : String;
|
||||
begin
|
||||
@ -188,11 +188,12 @@ function TDBDigestAnalyzer.GetContentsFromLongLog(Line: String): String;
|
||||
|
||||
var
|
||||
S : String;
|
||||
IsFirst, IsFound : boolean;
|
||||
IsFirst : boolean;
|
||||
InternalErrorPos : Integer;
|
||||
|
||||
begin
|
||||
Result:='';
|
||||
IsFound:=False;
|
||||
{ The "internalerror generated" message is not present in compilation log }
|
||||
InternalErrorPos:=pos(' internalerror generated',Line);
|
||||
if (InternalErrorPos>0) then
|
||||
@ -209,7 +210,7 @@ begin
|
||||
if (pos(Line,S)=0) and (pos(SeparationLine,S)>=1) then
|
||||
S:=GetLongLogLine
|
||||
end;
|
||||
if pos(Line,S)=1 then
|
||||
if pos(Line,S)>=1 then
|
||||
begin
|
||||
IsFound:=true;
|
||||
while HaveLongLogLine do
|
||||
@ -217,7 +218,16 @@ begin
|
||||
S:=GetLongLogLine;
|
||||
{ End of file marker }
|
||||
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;
|
||||
end;
|
||||
|
||||
if length(Result)<MaxLogSize then
|
||||
Result:=Result+S+LineEnding;
|
||||
if pos(SeparationLine,S)>1 then
|
||||
@ -232,7 +242,7 @@ begin
|
||||
end;
|
||||
if not IsFound then
|
||||
begin
|
||||
Verbose(V_Warning,'Line "'+Line+'" not found');
|
||||
Verbose(V_Warning,'Line "'+Line+'" not found. Starting over');
|
||||
FCurlongLogLine:=0; // Reset
|
||||
Inc(FLongLogRestartCount);
|
||||
end;
|
||||
@ -240,10 +250,15 @@ end;
|
||||
|
||||
function TDBDigestAnalyzer.GetLog(Line, FN: String): String;
|
||||
|
||||
var
|
||||
IsFound : boolean;
|
||||
|
||||
begin
|
||||
if UseLongLog then
|
||||
begin
|
||||
Result:=GetContentsFromLongLog(Line);
|
||||
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||
if not IsFound then
|
||||
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||
exit;
|
||||
end;
|
||||
FN:=ChangeFileExt(FN,'.log');
|
||||
@ -261,10 +276,15 @@ end;
|
||||
|
||||
function TDBDigestAnalyzer.GetExecuteLog(Line, FN: String): String;
|
||||
|
||||
var
|
||||
IsFound : Boolean;
|
||||
|
||||
begin
|
||||
if UseLongLog then
|
||||
begin
|
||||
Result:=GetContentsFromLongLog(Line);
|
||||
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||
if not IsFound then
|
||||
Result:=GetContentsFromLongLog(Line,IsFound);
|
||||
exit;
|
||||
end;
|
||||
FN:=ChangeFileExt(FN,'.elg');
|
||||
|
Loading…
Reference in New Issue
Block a user