Dbg: Tests

git-svn-id: trunk@28998 -
This commit is contained in:
martin 2011-01-13 16:54:40 +00:00
parent 3f3b8a3c89
commit f36c6193c8
3 changed files with 22 additions and 8 deletions

View File

@ -75,7 +75,14 @@ var
begin
FTesting := False;
Form1.Memo2.Lines.Add('***** '+ Parent.TestName + ' ' + Parent.Parent.TestName);
TestCompile(AppDir + 'WatchesPrg.pas', TestExeName);
try
TestCompile(Form1.edPasFile.Text, TestExeName);
except
on e: Exception do
Form1.Memo2.Lines.Add('Compile error: ' + e.Message);
end;
try
dbg := TGDBMIDebugger.Create(DebuggerInfo.ExeName);

View File

@ -12,23 +12,23 @@ uses
fpclist.txt contains lines of format:
[Name]
exe=/path/fpc.exe
symbols=gs,gw,gwset,gw3
symbols=none,gs,gw,gwset,gw3
gdblist.txt contains lines of format:
[Name]
exe=/path/fpc.exe
symbols=gs,gw,gwset,gw3
symbols=none,gs,gw,gwset,gw3
*)
type
TSymbolType = (stStabs, stDwarf, stDwarfSet, stDwarf3);
TSymbolType = (stNone, stStabs, stDwarf, stDwarfSet, stDwarf3);
TSymbolTypes = set of TSymbolType;
const
SymbolTypeNames: Array [TSymbolType] of String = ('Stabs', 'Dwarf', 'Dwarf+Sets', 'Dwarf3');
SymbolTypeSwitches: Array [TSymbolType] of String = ('-gs', '-gw', '-gw -godwarfsets', '-gw3');
SymbolTypeNames: Array [TSymbolType] of String = ('No_Dbg', 'Stabs', 'Dwarf', 'Dwarf+Sets', 'Dwarf3');
SymbolTypeSwitches: Array [TSymbolType] of String = ('', '-gs', '-gw', '-gw -godwarfsets', '-gw3');
type
@ -206,6 +206,7 @@ begin
s2 := s2 + s[1];
delete(s,1, 1);
end;
if s2 = 'none' then Result := Result + [stNone];
if s2 = 'gs' then Result := Result + [stStabs];
if s2 = 'gw' then Result := Result + [stDwarf];
if s2 = 'gwset' then Result := Result + [stDwarfSet];
@ -499,8 +500,10 @@ begin
raise EAssertionFailedError.Create('Found existing file before compiling: ' + ExeName);
FCompiledList.Add(ExeName);
ErrMsg := CompileHelpers.TestCompile(PrgName, FSymbolSwitch + ' ' + FCompilerInfo.ExtraOpts, ExeName, CompilerInfo.ExeName);
if ErrMsg <> '' then
if ErrMsg <> '' then begin
debugln(ErrMsg);
raise EAssertionFailedError.Create('Compilation Failed: ' + ExeName + LineEnding + ErrMsg);
end;
end;
if not FileExists(ExeName) then

View File

@ -547,7 +547,11 @@ var
i: Integer;
WList: Array of TTestWatch;
begin
TestCompile(AppDir + 'WatchesPrg.pas', TestExeName);
try
TestCompile(AppDir + 'WatchesPrg.pas', TestExeName);
except
on e: Exception do Fail('Compile error: ' + e.Message);
end;
try
FWatches := TBaseWatches.Create(TBaseWatch);