mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 14:39:27 +02:00
tests: seach examples directory recursively for example applications.
git-svn-id: trunk@10560 -
This commit is contained in:
parent
065a2e596b
commit
b9033c3702
@ -46,7 +46,7 @@
|
|||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="testglobals.pas"/>
|
<Filename Value="testglobals.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="testglobals"/>
|
<UnitName Value="TestGlobals"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
@ -101,19 +101,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
class function TLpiTest.ExamplesSuite: TTestSuite;
|
class function TLpiTest.ExamplesSuite: TTestSuite;
|
||||||
var
|
procedure SearchDirectory(const ADirectory: string);
|
||||||
SearchMask: String;
|
var
|
||||||
FileInfo: TSearchRec;
|
SearchMask: String;
|
||||||
|
FileInfo: TSearchRec;
|
||||||
|
begin
|
||||||
|
SearchMask := ADirectory + '*';
|
||||||
|
if FindFirst(SearchMask,faAnyFile,FileInfo)=0 then begin
|
||||||
|
repeat
|
||||||
|
// skip special directory entries
|
||||||
|
if (FileInfo.Name='.') or (FileInfo.Name='..') then continue;
|
||||||
|
|
||||||
|
if RightStr(FileInfo.Name,4)='.lpi' then
|
||||||
|
Result.AddTest(Suite(ADirectory + FileInfo.Name))
|
||||||
|
else if (FileInfo.Attr and faDirectory=faDirectory) then
|
||||||
|
SearchDirectory(AppendPathDelim(ADirectory+FileInfo.Name));
|
||||||
|
until FindNext(FileInfo)<>0;
|
||||||
|
end;
|
||||||
|
FindClose(FileInfo);
|
||||||
|
end;
|
||||||
begin
|
begin
|
||||||
Result := TTestSuite.Create('Examples');
|
Result := TTestSuite.Create('Examples');
|
||||||
SearchMask := ExamplesDir + '*.lpi';
|
SearchDirectory(AppendPathDelim(ExamplesDir))
|
||||||
if FindFirst(SearchMask,faAnyFile,FileInfo)=0 then begin
|
|
||||||
repeat
|
|
||||||
if RightStr(FileInfo.Name,4)='.lpi' then
|
|
||||||
Result.AddTest(Suite(ExamplesDir + FileInfo.Name));
|
|
||||||
until FindNext(FileInfo)<>0;
|
|
||||||
end;
|
|
||||||
FindClose(FileInfo);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLpiTest.TestCompile;
|
procedure TLpiTest.TestCompile;
|
||||||
|
Loading…
Reference in New Issue
Block a user