DBG: tests, better appdir detection

git-svn-id: trunk@28659 -
This commit is contained in:
martin 2010-12-09 20:43:41 +00:00
parent 78fb13e2de
commit f348fe1d0f
2 changed files with 137 additions and 120 deletions

View File

@ -42,29 +42,29 @@
<PackageName Value="FCL"/>
</Item4>
</RequiredPackages>
<Units Count="27">
<Units Count="28">
<Unit0>
<Filename Value="TestGdbmi.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="TestGdbmi"/>
<UsageCount Value="57"/>
<UsageCount Value="72"/>
</Unit0>
<Unit1>
<Filename Value="testexception.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="TestException"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<WindowIndex Value="1"/>
<TopLine Value="17"/>
<CursorPos X="46" Y="58"/>
<CursorPos X="1" Y="56"/>
<ExtraEditorCount Value="1"/>
<ExtraEditor1>
<EditorIndex Value="0"/>
<WindowIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="17"/>
<CursorPos X="1" Y="56"/>
<CursorPos X="1" Y="51"/>
</ExtraEditor1>
<UsageCount Value="57"/>
<UsageCount Value="72"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
@ -74,7 +74,7 @@
<WindowIndex Value="1"/>
<TopLine Value="29"/>
<CursorPos X="1" Y="79"/>
<UsageCount Value="25"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
@ -82,23 +82,24 @@
<WindowIndex Value="0"/>
<TopLine Value="599"/>
<CursorPos X="14" Y="634"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit3>
<Unit4>
<Filename Value="C:\FPC\SVN\trunc\rtl\objpas\classes\stringl.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="1160"/>
<CursorPos X="3" Y="1170"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit4>
<Unit5>
<Filename Value="testbase.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="TestBase"/>
<EditorIndex Value="6"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="5"/>
<WindowIndex Value="1"/>
<TopLine Value="595"/>
<CursorPos X="1" Y="653"/>
<TopLine Value="616"/>
<CursorPos X="1" Y="652"/>
<ExtraEditorCount Value="1"/>
<ExtraEditor1>
<EditorIndex Value="5"/>
@ -107,7 +108,7 @@
<CursorPos X="69" Y="129"/>
<IsLocked Value="True"/>
</ExtraEditor1>
<UsageCount Value="51"/>
<UsageCount Value="66"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
@ -116,9 +117,9 @@
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="6589"/>
<CursorPos X="7" Y="6631"/>
<UsageCount Value="25"/>
<TopLine Value="3255"/>
<CursorPos X="26" Y="3318"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
@ -127,15 +128,15 @@
<WindowIndex Value="0"/>
<TopLine Value="3152"/>
<CursorPos X="3" Y="3159"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit7>
<Unit8>
<Filename Value="A:\debugger\test\Gdbmi\gdblist.txt"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="5" Y="1"/>
<UsageCount Value="25"/>
<CursorPos X="7" Y="42"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="None"/>
</Unit8>
@ -144,8 +145,8 @@
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="14" Y="3"/>
<UsageCount Value="25"/>
<CursorPos X="18" Y="3"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="None"/>
</Unit9>
@ -154,7 +155,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="2"/>
<UsageCount Value="7"/>
<UsageCount Value="5"/>
<DefaultSyntaxHighlighter Value="None"/>
</Unit10>
<Unit11>
@ -164,7 +165,7 @@
<WindowIndex Value="1"/>
<TopLine Value="71"/>
<CursorPos X="20" Y="129"/>
<UsageCount Value="24"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
@ -173,7 +174,7 @@
<WindowIndex Value="1"/>
<TopLine Value="992"/>
<CursorPos X="1" Y="1026"/>
<UsageCount Value="22"/>
<UsageCount Value="20"/>
</Unit12>
<Unit13>
<Filename Value="A:\debugger\test\Gdbmi\TestApps\ExceptPrg.pas"/>
@ -181,7 +182,7 @@
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="5" Y="21"/>
<UsageCount Value="21"/>
<UsageCount Value="19"/>
</Unit13>
<Unit14>
<Filename Value="C:\FPC\SVN\trunc\packages\fcl-fpcunit\src\testregistry.pp"/>
@ -189,7 +190,7 @@
<WindowIndex Value="1"/>
<TopLine Value="86"/>
<CursorPos X="24" Y="117"/>
<UsageCount Value="12"/>
<UsageCount Value="10"/>
<Bookmarks Count="1">
<Item0 X="1" Y="30" ID="1"/>
</Bookmarks>
@ -200,7 +201,7 @@
<WindowIndex Value="1"/>
<TopLine Value="668"/>
<CursorPos X="1" Y="712"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit15>
<Unit16>
<Filename Value="C:\FPC\SVN\trunc\rtl\win32\system.pp"/>
@ -208,7 +209,7 @@
<WindowIndex Value="1"/>
<TopLine Value="2"/>
<CursorPos X="2" Y="37"/>
<UsageCount Value="11"/>
<UsageCount Value="9"/>
</Unit16>
<Unit17>
<Filename Value="..\..\..\lcl\fileutil.pas"/>
@ -216,39 +217,38 @@
<WindowIndex Value="1"/>
<TopLine Value="75"/>
<CursorPos X="10" Y="110"/>
<UsageCount Value="11"/>
<UsageCount Value="9"/>
</Unit17>
<Unit18>
<Filename Value="..\..\..\lcl\include\fileutil.inc"/>
<WindowIndex Value="1"/>
<TopLine Value="1441"/>
<CursorPos X="3" Y="1443"/>
<UsageCount Value="11"/>
<UsageCount Value="9"/>
</Unit18>
<Unit19>
<Filename Value="..\..\..\lcl\include\winfileutil.inc"/>
<WindowIndex Value="1"/>
<TopLine Value="1"/>
<CursorPos X="3" Y="14"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit19>
<Unit20>
<Filename Value="C:\FPC\SVN\trunc\rtl\objpas\sysutils\finah.inc"/>
<WindowIndex Value="1"/>
<TopLine Value="1"/>
<CursorPos X="10" Y="26"/>
<UsageCount Value="10"/>
<UsageCount Value="8"/>
</Unit20>
<Unit21>
<Filename Value="testwatches.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="Testwatches"/>
<IsVisibleTab Value="True"/>
<UnitName Value="TestWatches"/>
<EditorIndex Value="1"/>
<WindowIndex Value="1"/>
<TopLine Value="42"/>
<CursorPos X="1" Y="88"/>
<UsageCount Value="24"/>
<TopLine Value="123"/>
<CursorPos X="1" Y="134"/>
<UsageCount Value="39"/>
<Loaded Value="True"/>
</Unit21>
<Unit22>
@ -257,178 +257,182 @@
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="23" Y="15"/>
<UsageCount Value="12"/>
<CursorPos X="32" Y="39"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit22>
<Unit23>
<Filename Value="..\..\debugger.pp"/>
<UnitName Value="Debugger"/>
<EditorIndex Value="3"/>
<EditorIndex Value="2"/>
<WindowIndex Value="1"/>
<TopLine Value="3403"/>
<CursorPos X="19" Y="3437"/>
<UsageCount Value="11"/>
<TopLine Value="5526"/>
<CursorPos X="53" Y="5567"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit23>
<Unit24>
<Filename Value="..\..\debugutils.pp"/>
<UnitName Value="DebugUtils"/>
<EditorIndex Value="5"/>
<EditorIndex Value="4"/>
<WindowIndex Value="1"/>
<TopLine Value="274"/>
<CursorPos X="3" Y="302"/>
<UsageCount Value="11"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit24>
<Unit25>
<Filename Value="C:\FPC\SVN\trunc\rtl\inc\generic.inc"/>
<EditorIndex Value="4"/>
<EditorIndex Value="3"/>
<WindowIndex Value="1"/>
<TopLine Value="789"/>
<CursorPos X="1" Y="827"/>
<UsageCount Value="11"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit25>
<Unit26>
<Filename Value="C:\FPC\SVN\trunc\rtl\i386\i386.inc"/>
<EditorIndex Value="2"/>
<WindowIndex Value="1"/>
<TopLine Value="1558"/>
<CursorPos X="1" Y="1603"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
<UsageCount Value="18"/>
</Unit26>
<Unit27>
<Filename Value="C:\FPC\SVN\trunc\rtl\objpas\sysutils\sysstrh.inc"/>
<EditorIndex Value="6"/>
<WindowIndex Value="1"/>
<TopLine Value="200"/>
<CursorPos X="10" Y="266"/>
<UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit27>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6603" Column="1" TopLine="6594"/>
<Filename Value="testwatches.pas"/>
<Caret Line="128" Column="81" TopLine="72"/>
</Position1>
<Position2>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6604" Column="1" TopLine="6594"/>
<Filename Value="testwatches.pas"/>
<Caret Line="137" Column="74" TopLine="72"/>
</Position2>
<Position3>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6605" Column="1" TopLine="6594"/>
<Filename Value="testwatches.pas"/>
<Caret Line="76" Column="7" TopLine="73"/>
</Position3>
<Position4>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6610" Column="5" TopLine="6594"/>
<Filename Value="testwatches.pas"/>
<Caret Line="84" Column="12" TopLine="60"/>
</Position4>
<Position5>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6608" Column="1" TopLine="6594"/>
<Filename Value="testwatches.pas"/>
<Caret Line="108" Column="85" TopLine="73"/>
</Position5>
<Position6>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6610" Column="1" TopLine="6594"/>
<Filename Value="testwatches.pas"/>
<Caret Line="84" Column="54" TopLine="76"/>
</Position6>
<Position7>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="7863" Column="1" TopLine="7828"/>
<Filename Value="testwatches.pas"/>
<Caret Line="114" Column="30" TopLine="76"/>
</Position7>
<Position8>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="8535" Column="1" TopLine="8500"/>
<Filename Value="testwatches.pas"/>
<Caret Line="52" Column="29" TopLine="18"/>
</Position8>
<Position9>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="8536" Column="1" TopLine="8500"/>
<Filename Value="testwatches.pas"/>
<Caret Line="85" Column="3" TopLine="83"/>
</Position9>
<Position10>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="8537" Column="1" TopLine="8500"/>
<Filename Value="testwatches.pas"/>
<Caret Line="150" Column="29" TopLine="102"/>
</Position10>
<Position11>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="4751" Column="1" TopLine="4716"/>
<Filename Value="testwatches.pas"/>
<Caret Line="83" Column="58" TopLine="48"/>
</Position11>
<Position12>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="4752" Column="1" TopLine="4716"/>
<Filename Value="testwatches.pas"/>
<Caret Line="52" Column="49" TopLine="52"/>
</Position12>
<Position13>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="4754" Column="1" TopLine="4716"/>
<Filename Value="testwatches.pas"/>
<Caret Line="85" Column="6" TopLine="51"/>
</Position13>
<Position14>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="4757" Column="1" TopLine="4716"/>
<Caret Line="6638" Column="36" TopLine="6618"/>
</Position14>
<Position15>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="4761" Column="1" TopLine="4716"/>
<Filename Value="testwatches.pas"/>
<Caret Line="146" Column="81" TopLine="114"/>
</Position15>
<Position16>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="4767" Column="1" TopLine="4716"/>
<Caret Line="8964" Column="91" TopLine="8900"/>
</Position16>
<Position17>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="4816" Column="1" TopLine="4781"/>
<Caret Line="3000" Column="33" TopLine="2967"/>
</Position17>
<Position18>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6636" Column="1" TopLine="6601"/>
<Filename Value="testbase.pas"/>
<Caret Line="656" Column="6" TopLine="595"/>
</Position18>
<Position19>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6641" Column="1" TopLine="6601"/>
<Filename Value="testbase.pas"/>
<Caret Line="637" Column="26" TopLine="595"/>
</Position19>
<Position20>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6692" Column="1" TopLine="6657"/>
<Filename Value="testbase.pas"/>
<Caret Line="9" Column="52" TopLine="1"/>
</Position20>
<Position21>
<Filename Value="..\..\debugger.pp"/>
<Caret Line="3437" Column="19" TopLine="3403"/>
<Filename Value="testbase.pas"/>
<Caret Line="640" Column="6" TopLine="610"/>
</Position21>
<Position22>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6626" Column="1" TopLine="6606"/>
<Filename Value="testbase.pas"/>
<Caret Line="652" Column="1" TopLine="616"/>
</Position22>
<Position23>
<Filename Value="testwatches.pas"/>
<Caret Line="66" Column="36" TopLine="39"/>
<Filename Value="testbase.pas"/>
<Caret Line="686" Column="1" TopLine="616"/>
</Position23>
<Position24>
<Filename Value="testwatches.pas"/>
<Caret Line="49" Column="1" TopLine="39"/>
<Filename Value="testbase.pas"/>
<Caret Line="658" Column="13" TopLine="616"/>
</Position24>
<Position25>
<Filename Value="..\..\gdbmidebugger.pp"/>
<Caret Line="6626" Column="59" TopLine="6573"/>
<Filename Value="testbase.pas"/>
<Caret Line="652" Column="7" TopLine="616"/>
</Position25>
<Position26>
<Filename Value="testwatches.pas"/>
<Caret Line="96" Column="18" TopLine="42"/>
<Filename Value="testbase.pas"/>
<Caret Line="662" Column="42" TopLine="616"/>
</Position26>
<Position27>
<Filename Value="testwatches.pas"/>
<Caret Line="85" Column="14" TopLine="42"/>
<Filename Value="testbase.pas"/>
<Caret Line="656" Column="1" TopLine="616"/>
</Position27>
<Position28>
<Filename Value="testwatches.pas"/>
<Caret Line="97" Column="1" TopLine="42"/>
<Filename Value="testbase.pas"/>
<Caret Line="658" Column="1" TopLine="616"/>
</Position28>
<Position29>
<Filename Value="testwatches.pas"/>
<Caret Line="98" Column="1" TopLine="42"/>
<Filename Value="testbase.pas"/>
<Caret Line="659" Column="1" TopLine="616"/>
</Position29>
<Position30>
<Filename Value="testwatches.pas"/>
<Caret Line="81" Column="9" TopLine="42"/>
<Filename Value="testbase.pas"/>
<Caret Line="660" Column="1" TopLine="616"/>
</Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="TestGdbmi.exe"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib"/>
@ -441,15 +445,9 @@
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="1">
<Item1>
<Source Value="testexception.pas"/>
<Line Value="51"/>
</Item1>
</BreakPoints>
<Watches Count="1">
<Item1>
<Expression Value="FTestIntWatch"/>
<Expression Value="AppDir"/>
</Item1>
</Watches>
<Exceptions Count="4">

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, FileUtil, fpcunit, testutils, testregistry,
EnvironmentOpts, LCLProc, CompileHelpers;
EnvironmentOpts, LCLProc, CompileHelpers, Dialogs;
(*
fpclist.txt contains lines of format:
@ -649,7 +649,26 @@ end;
initialization
AppDir := AppendPathDelim(AppendPathDelim(ExtractFilePath(Paramstr(0))) + 'TestApps');
AppDir := AppendPathDelim(ExtractFilePath(Paramstr(0)));
if DirectoryExistsUTF8(AppDir + 'TestApps') then
AppDir := AppendPathDelim(AppDir + 'TestApps')
else
if RightStr(AppDir, length('lib' + DirectorySeparator)) = 'lib' + DirectorySeparator
then begin
AppDir := copy(AppDir, 1, length(AppDir) - length('lib' + DirectorySeparator));
if DirectoryExistsUTF8(AppDir + 'TestApps') then
AppDir := AppendPathDelim(AppDir + 'TestApps')
else with TSelectDirectoryDialog.Create(nil) do begin
if Execute then AppDir := FileName;
Free;
end;
end
else with TSelectDirectoryDialog.Create(nil) do begin
if Execute then AppDir := FileName;
Free;
end;
EnvironmentOptions := TEnvironmentOptions.Create;
with EnvironmentOptions do
begin