mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 12:48:17 +02:00
test: moved bugtestcase to runtest project
git-svn-id: trunk@10558 -
This commit is contained in:
parent
f060c5cd2a
commit
5c89a11221
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -2838,9 +2838,7 @@ test/bugs/7462/expected.txt svneol=native#text/plain
|
||||
test/bugs/7462/unit1.lfm svneol=native#text/plain
|
||||
test/bugs/7462/unit1.lrs svneol=native#text/plain
|
||||
test/bugs/7462/unit1.pas svneol=native#text/plain
|
||||
test/bugs/bugtestcase.pas svneol=native#text/plain
|
||||
test/bugs/runbugtestcases.lpi svneol=native#text/plain
|
||||
test/bugs/runbugtestcases.lpr svneol=native#text/plain
|
||||
test/bugtestcase.pas svneol=native#text/plain
|
||||
test/hello.ahk svneol=native#text/plain
|
||||
test/readme.txt svneol=native#text/plain
|
||||
test/runtests.lpi svneol=native#text/plain
|
||||
|
@ -1,60 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="5"/>
|
||||
<General>
|
||||
<SessionStorage Value="InIDEConfig"/>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<ProjectVersion Value=""/>
|
||||
</VersionInfo>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="3">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="FPCUnitTestRunner"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="runbugtestcases.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="runbugtestcases"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="bugtestcase.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="BugTestCase"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<PathDelim Value="\"/>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
</CONFIG>
|
@ -1,13 +0,0 @@
|
||||
program runbugtestcases;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Interfaces, Forms, GuiTestRunner, BugTestCase;
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TGuiTestRunner, TestRunner);
|
||||
Application.Run;
|
||||
end.
|
||||
|
@ -1,3 +1,21 @@
|
||||
{ $Id$}
|
||||
{ Copyright (C) 2007 Vincent Snijders
|
||||
|
||||
This source is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
A copy of the GNU General Public License is available on the World Wide Web
|
||||
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
|
||||
to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
}
|
||||
unit BugTestCase;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
@ -5,7 +23,8 @@ unit BugTestCase;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Math, process, fileutil, fpcunit, testutils, testregistry;
|
||||
Classes, SysUtils, Math, process, fileutil, fpcunit, testutils, testregistry,
|
||||
TestGlobals;
|
||||
|
||||
type
|
||||
|
||||
@ -15,9 +34,6 @@ type
|
||||
private
|
||||
FPath: string;
|
||||
FProjectFile: string;
|
||||
protected
|
||||
procedure SetUp; override;
|
||||
procedure TearDown; override;
|
||||
public
|
||||
constructor Create(APath, ATestName: string); reintroduce;
|
||||
class function CreateSuite(Path: string) : TTestSuite;
|
||||
@ -28,9 +44,6 @@ type
|
||||
procedure HeaptrcLog;
|
||||
end;
|
||||
|
||||
var
|
||||
Compiler: string;
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
@ -103,7 +116,7 @@ var
|
||||
begin
|
||||
AssertTrue('Project file '+ FProjectFile + ' does not exist',
|
||||
FileExists(FProjectFile));
|
||||
LazarusDir := ExpandFileName(ExtractFilePath(ParamStr(0)) + '../../');
|
||||
LazarusDir := ExpandFileName(ExtractFilePath(ParamStr(0)) + '../');
|
||||
LazBuildPath := LazarusDir + 'lazbuild' + GetExeExt;
|
||||
AssertTrue(LazBuildPath + ' does not exist', FileExists(LazBuildPath));
|
||||
LazBuild := TProcess.Create(nil);
|
||||
@ -186,14 +199,6 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TBugTestCase.SetUp;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TBugTestCase.TearDown;
|
||||
begin
|
||||
end;
|
||||
|
||||
constructor TBugTestCase.Create(APath, ATestName: string);
|
||||
begin
|
||||
CreateWithName(ATestName);
|
||||
@ -217,15 +222,18 @@ procedure GatherTests;
|
||||
var
|
||||
ProgPath: string;
|
||||
SearchRec: TSearchRec;
|
||||
BugsTestSuite: TTestSuite;
|
||||
begin
|
||||
ProgPath := ExtractFilePath(ParamStr(0));
|
||||
BugsTestSuite := TTestSuite.Create('Bugs');
|
||||
GetTestRegistry.AddTest(BugsTestSuite);
|
||||
ProgPath := ExtractFilePath(ParamStr(0)) + 'bugs' + pathdelim;
|
||||
if FindFirst(ProgPath+'*', faAnyFile, SearchRec)=0 then
|
||||
repeat
|
||||
if (SearchRec.Attr and (faDirectory + faHidden)=faDirectory) and
|
||||
(SearchRec.Name<>'.') and (SearchRec.Name<>'..') and
|
||||
(SearchRec.Name<>'.svn')
|
||||
then
|
||||
GetTestRegistry.AddTest(
|
||||
BugsTestSuite.AddTest(
|
||||
TBugTestCase.CreateSuite(ProgPath+SearchRec.Name));
|
||||
until FindNext(SearchRec)<>0;
|
||||
FindClose(SearchRec);
|
@ -32,7 +32,7 @@
|
||||
<PackageName Value="FCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Units Count="4">
|
||||
<Unit0>
|
||||
<Filename Value="runtests.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -48,6 +48,11 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="FPCUnitProject1"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="bugtestcase.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="BugTestCase"/>
|
||||
</Unit3>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ $Id: $}
|
||||
{ $Id$}
|
||||
{ Copyright (C) 2006 Vincent Snijders
|
||||
|
||||
This source is free software; you can redistribute it and/or modify it under
|
||||
@ -21,7 +21,8 @@ program runtests;
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Classes, TestLpi, consoletestrunner;
|
||||
Classes, consoletestrunner,
|
||||
testglobals, TestLpi, BugTestCase;
|
||||
|
||||
type
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
<PackageName Value="FCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="runtestsgui.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -43,6 +43,11 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestLpi"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="testglobals.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="testglobals"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -1,9 +1,29 @@
|
||||
{ $Id$}
|
||||
{ Copyright (C) 2006 Vincent Snijders
|
||||
|
||||
This source is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
A copy of the GNU General Public License is available on the World Wide Web
|
||||
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
|
||||
to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
}
|
||||
program runtestsgui;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Interfaces, Forms, GuiTestRunner, TestLpi;
|
||||
Interfaces, Forms,
|
||||
GuiTestRunner,
|
||||
TestLpi, BugTestCase;
|
||||
|
||||
begin
|
||||
Application.Title:='Run Lazarus tests';
|
||||
|
@ -1,3 +1,21 @@
|
||||
{ $Id$}
|
||||
{ Copyright (C) 2006 Vincent Snijders
|
||||
|
||||
This source is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
A copy of the GNU General Public License is available on the World Wide Web
|
||||
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
|
||||
to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
}
|
||||
unit TestLpi;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
@ -5,7 +23,8 @@ unit TestLpi;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testregistry, process, FileUtil;
|
||||
Classes, SysUtils, fpcunit, testregistry, process, FileUtil,
|
||||
TestGlobals;
|
||||
|
||||
type
|
||||
|
||||
@ -24,9 +43,6 @@ type
|
||||
procedure TestRun;
|
||||
end;
|
||||
|
||||
var
|
||||
Compiler: string;
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user