mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 21:00:43 +02:00
DBG: Tests
git-svn-id: trunk@32651 -
This commit is contained in:
parent
9d45bfaa7e
commit
1adda67314
@ -13,3 +13,7 @@ symbols=gs,gw,gwset
|
|||||||
exe=c:\FPC\trunk\bin\i386-win32\fpc.exe
|
exe=c:\FPC\trunk\bin\i386-win32\fpc.exe
|
||||||
symbols=gs,gw,gwset,gw3
|
symbols=gs,gw,gwset,gw3
|
||||||
|
|
||||||
|
[fpc trunk external linker]
|
||||||
|
exe=c:\FPC\trunk\bin\i386-win32\fpc.exe
|
||||||
|
symbols=gs,gw,gwset,gw3
|
||||||
|
opts=-Xe
|
||||||
|
@ -208,12 +208,14 @@ type
|
|||||||
FTestCnt, FTestErrorCnt, FIgnoredErrorCnt, FUnexpectedSuccessCnt, FSucessCnt: Integer;
|
FTestCnt, FTestErrorCnt, FIgnoredErrorCnt, FUnexpectedSuccessCnt, FSucessCnt: Integer;
|
||||||
FCurrentPrgName, FCurrentExename: String;
|
FCurrentPrgName, FCurrentExename: String;
|
||||||
FLogFile: TextFile;
|
FLogFile: TextFile;
|
||||||
|
FLogFileCreated: Boolean;
|
||||||
function GetCompilerInfo: TCompilerInfo;
|
function GetCompilerInfo: TCompilerInfo;
|
||||||
function GetDebuggerInfo: TDebuggerInfo;
|
function GetDebuggerInfo: TDebuggerInfo;
|
||||||
function GetSymbolType: TSymbolType;
|
function GetSymbolType: TSymbolType;
|
||||||
protected
|
protected
|
||||||
function CreateResult: TTestResult; override;
|
function CreateResult: TTestResult; override;
|
||||||
function GetLogActive: Boolean;
|
function GetLogActive: Boolean;
|
||||||
|
procedure CreateLog;
|
||||||
procedure SetUp; override;
|
procedure SetUp; override;
|
||||||
procedure TearDown; override;
|
procedure TearDown; override;
|
||||||
procedure DoDbgOutPut(Sender: TObject; const AText: String); virtual;
|
procedure DoDbgOutPut(Sender: TObject; const AText: String); virtual;
|
||||||
@ -236,6 +238,7 @@ type
|
|||||||
Procedure TestCompile(const PrgName: string; out ExeName: string; NamePostFix: String=''; ExtraArgs: String=''); overload;
|
Procedure TestCompile(const PrgName: string; out ExeName: string; NamePostFix: String=''; ExtraArgs: String=''); overload;
|
||||||
Procedure TestCompile(const PrgName: string; out ExeName: string; UsesDirs: array of TUsesDir;
|
Procedure TestCompile(const PrgName: string; out ExeName: string; UsesDirs: array of TUsesDir;
|
||||||
NamePostFix: String=''; ExtraArgs: String=''); overload;
|
NamePostFix: String=''; ExtraArgs: String=''); overload;
|
||||||
|
function SkipTest: Boolean;
|
||||||
public
|
public
|
||||||
property Parent: TGDBTestsuite read FParent write FParent;
|
property Parent: TGDBTestsuite read FParent write FParent;
|
||||||
property DebuggerInfo: TDebuggerInfo read GetDebuggerInfo;
|
property DebuggerInfo: TDebuggerInfo read GetDebuggerInfo;
|
||||||
@ -270,6 +273,8 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses TestGDBMIControl;
|
||||||
|
|
||||||
var
|
var
|
||||||
Compilers: TCompilerList = nil;
|
Compilers: TCompilerList = nil;
|
||||||
Debuggers: TDebuggerList = nil;
|
Debuggers: TDebuggerList = nil;
|
||||||
@ -346,6 +351,7 @@ end;
|
|||||||
procedure TGDBTestCase.InternalDbgOutPut(Sender: TObject; const AText: String);
|
procedure TGDBTestCase.InternalDbgOutPut(Sender: TObject; const AText: String);
|
||||||
begin
|
begin
|
||||||
if GetLogActive then begin
|
if GetLogActive then begin
|
||||||
|
CreateLog;
|
||||||
writeln(FLogFile, AText);
|
writeln(FLogFile, AText);
|
||||||
end;
|
end;
|
||||||
DoDbgOutPut(Sender, AText);
|
DoDbgOutPut(Sender, AText);
|
||||||
@ -382,13 +388,14 @@ begin
|
|||||||
Result := WriteLog;
|
Result := WriteLog;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBTestCase.SetUp;
|
procedure TGDBTestCase.CreateLog;
|
||||||
var
|
var
|
||||||
name: String;
|
name: String;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
dir: String;
|
dir: String;
|
||||||
begin
|
begin
|
||||||
if GetLogActive then begin
|
if FLogFileCreated then exit;
|
||||||
|
//if GetLogActive then begin
|
||||||
name := TestName
|
name := TestName
|
||||||
+ '_' + NameToFileName(GetCompilerInfo.Name)
|
+ '_' + NameToFileName(GetCompilerInfo.Name)
|
||||||
+ '_' + SymbolTypeNames[GetSymbolType]
|
+ '_' + SymbolTypeNames[GetSymbolType]
|
||||||
@ -403,14 +410,20 @@ begin
|
|||||||
name[i] := '_';
|
name[i] := '_';
|
||||||
AssignFile(FLogFile, Dir + name);
|
AssignFile(FLogFile, Dir + name);
|
||||||
Rewrite(FLogFile);
|
Rewrite(FLogFile);
|
||||||
end;
|
FLogFileCreated := True;
|
||||||
|
//end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TGDBTestCase.SetUp;
|
||||||
|
begin
|
||||||
|
FLogFileCreated := False;
|
||||||
inherited SetUp;
|
inherited SetUp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBTestCase.TearDown;
|
procedure TGDBTestCase.TearDown;
|
||||||
begin
|
begin
|
||||||
inherited TearDown;
|
inherited TearDown;
|
||||||
if GetLogActive then begin
|
if FLogFileCreated then begin
|
||||||
CloseFile(FLogFile);
|
CloseFile(FLogFile);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -430,6 +443,7 @@ begin
|
|||||||
FRegisters := TIDERegisters.Create;
|
FRegisters := TIDERegisters.Create;
|
||||||
|
|
||||||
Result := GdbClass.Create(DebuggerInfo.ExeName);
|
Result := GdbClass.Create(DebuggerInfo.ExeName);
|
||||||
|
Result.OnDbgOutput := @InternalDbgOutPut;
|
||||||
|
|
||||||
//TManagedBreakpoints(FBreakpoints).Master := FDebugger.BreakPoints;
|
//TManagedBreakpoints(FBreakpoints).Master := FDebugger.BreakPoints;
|
||||||
FWatches.Supplier := Result.Watches;
|
FWatches.Supplier := Result.Watches;
|
||||||
@ -449,7 +463,6 @@ begin
|
|||||||
Result.FileName := TestExeName;
|
Result.FileName := TestExeName;
|
||||||
Result.Arguments := '';
|
Result.Arguments := '';
|
||||||
Result.ShowConsole := True;
|
Result.ShowConsole := True;
|
||||||
Result.OnDbgOutput := @InternalDbgOutPut;
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -583,6 +596,7 @@ begin
|
|||||||
[FTestErrorCnt, FTestCnt, FIgnoredErrorCnt, FUnexpectedSuccessCnt, FSucessCnt ]);
|
[FTestErrorCnt, FTestCnt, FIgnoredErrorCnt, FUnexpectedSuccessCnt, FSucessCnt ]);
|
||||||
FTestErrors := '';
|
FTestErrors := '';
|
||||||
if GetLogActive then begin
|
if GetLogActive then begin
|
||||||
|
CreateLog;
|
||||||
writeln(FLogFile, '***' + s1 + '***' +LineEnding);
|
writeln(FLogFile, '***' + s1 + '***' +LineEnding);
|
||||||
writeln(FLogFile, '================= Failed:'+LineEnding);
|
writeln(FLogFile, '================= Failed:'+LineEnding);
|
||||||
writeln(FLogFile, s);
|
writeln(FLogFile, s);
|
||||||
@ -607,6 +621,7 @@ procedure TGDBTestCase.TestCompile(const PrgName: string; out ExeName: string;
|
|||||||
UsesDirs: array of TUsesDir; NamePostFix: String; ExtraArgs: String);
|
UsesDirs: array of TUsesDir; NamePostFix: String; ExtraArgs: String);
|
||||||
begin
|
begin
|
||||||
if GetLogActive then begin
|
if GetLogActive then begin
|
||||||
|
CreateLog;
|
||||||
writeln(FLogFile, LineEnding+LineEnding+'******************* compile '+PrgName + ' ' + ExtraArgs +LineEnding);
|
writeln(FLogFile, LineEnding+LineEnding+'******************* compile '+PrgName + ' ' + ExtraArgs +LineEnding);
|
||||||
end;
|
end;
|
||||||
Parent.TestCompile(PrgName, ExeName, UsesDirs, NamePostFix, ExtraArgs);
|
Parent.TestCompile(PrgName, ExeName, UsesDirs, NamePostFix, ExtraArgs);
|
||||||
@ -614,6 +629,13 @@ begin
|
|||||||
FCurrentExename := ExeName;
|
FCurrentExename := ExeName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TGDBTestCase.SkipTest: Boolean;
|
||||||
|
begin
|
||||||
|
Result := not TestControlForm.chkGDB.Checked[TestControlForm.chkGDB.Items.IndexOf(DebuggerInfo.Name)];
|
||||||
|
Result := Result or
|
||||||
|
not TestControlForm.chkFPC.Checked[TestControlForm.chkFPC.Items.IndexOf(CompilerInfo.Name)];
|
||||||
|
end;
|
||||||
|
|
||||||
{ TBaseList }
|
{ TBaseList }
|
||||||
|
|
||||||
procedure TBaseList.LoadFromFile(const AFileName: string);
|
procedure TBaseList.LoadFromFile(const AFileName: string);
|
||||||
|
Loading…
Reference in New Issue
Block a user