mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-01 18:55:58 +02:00
Starts adding semi-automatic tests
git-svn-id: trunk@27856 -
This commit is contained in:
parent
b35808d50f
commit
3ea22f0862
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -5460,6 +5460,8 @@ test/runtests.lpi svneol=native#text/plain
|
|||||||
test/runtests.lpr svneol=native#text/plain
|
test/runtests.lpr svneol=native#text/plain
|
||||||
test/runtestsgui.lpi svneol=native#text/plain
|
test/runtestsgui.lpi svneol=native#text/plain
|
||||||
test/runtestsgui.lpr svneol=native#text/plain
|
test/runtestsgui.lpr svneol=native#text/plain
|
||||||
|
test/semiauto/idesemiautotests.pas svneol=native#text/pascal
|
||||||
|
test/semiauto/semiautotest.pas svneol=native#text/pascal
|
||||||
test/testglobals.pas svneol=native#text/plain
|
test/testglobals.pas svneol=native#text/plain
|
||||||
test/testlpi.pas svneol=native#text/plain
|
test/testlpi.pas svneol=native#text/plain
|
||||||
test/testresult-db/createdb.sql svneol=native#text/plain
|
test/testresult-db/createdb.sql svneol=native#text/plain
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
<PackageName Value="CodeTools"/>
|
<PackageName Value="CodeTools"/>
|
||||||
</Item4>
|
</Item4>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="9">
|
<Units Count="11">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="runtestsgui.lpr"/>
|
<Filename Value="runtestsgui.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -86,13 +86,23 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="TestPen"/>
|
<UnitName Value="TestPen"/>
|
||||||
</Unit8>
|
</Unit8>
|
||||||
|
<Unit9>
|
||||||
|
<Filename Value="semiauto\semiautotest.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="semiautotest"/>
|
||||||
|
</Unit9>
|
||||||
|
<Unit10>
|
||||||
|
<Filename Value="semiauto\idesemiautotests.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="idesemiautotests"/>
|
||||||
|
</Unit10>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="9"/>
|
<Version Value="9"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<OtherUnitFiles Value="bugs;lcltests"/>
|
<OtherUnitFiles Value="bugs;lcltests;semiauto"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<Parsing>
|
<Parsing>
|
||||||
<SyntaxOptions>
|
<SyntaxOptions>
|
||||||
|
@ -23,7 +23,7 @@ program runtestsgui;
|
|||||||
uses
|
uses
|
||||||
Interfaces, Forms,
|
Interfaces, Forms,
|
||||||
GuiTestRunner,
|
GuiTestRunner,
|
||||||
testunits;
|
testunits, idesemiautotests, semiautotest;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Application.Title:='Run Lazarus tests';
|
Application.Title:='Run Lazarus tests';
|
||||||
|
42
test/semiauto/idesemiautotests.pas
Normal file
42
test/semiauto/idesemiautotests.pas
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
unit idesemiautotests;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, fpcunit,
|
||||||
|
Interfaces, LCLType, LCLIntf,
|
||||||
|
testglobals, semiautotest;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TTestIdeNew }
|
||||||
|
|
||||||
|
TTestIdeNew = class(TSemiAutomaticTest)
|
||||||
|
published
|
||||||
|
procedure TestOne;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TTestIdeNew }
|
||||||
|
|
||||||
|
procedure TTestIdeNew.TestOne;
|
||||||
|
var
|
||||||
|
Str: string;
|
||||||
|
begin
|
||||||
|
Str := 'Please follow the following steps and mark if the test was successful:' + LineEnding
|
||||||
|
+ '1> Open Lazarus' + LineEnding
|
||||||
|
+ '2> Start a new Application project, but don''t save it' + LineEnding
|
||||||
|
+ '3> Run this new project' + LineEnding
|
||||||
|
+ 'Expected result> It should be saved to a temporary location and run or a message dialog should appear saying that the operation is impossible' + LineEnding
|
||||||
|
;
|
||||||
|
AssertTrue(ShowResultDialog('TTestIdeNew.TestOne', Str));
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
AddToSemiAutoTestSuite(TTestIdeNew);
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
32
test/semiauto/semiautotest.pas
Normal file
32
test/semiauto/semiautotest.pas
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
unit semiautotest;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, fpcunit,
|
||||||
|
Interfaces, Forms, LCLType,
|
||||||
|
testglobals;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TSemiAutomaticTest }
|
||||||
|
|
||||||
|
TSemiAutomaticTest = class(TTestCase)
|
||||||
|
public
|
||||||
|
function ShowResultDialog(const ATitle, AInstructions: string): Boolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TSemiAutomaticTest }
|
||||||
|
|
||||||
|
function TSemiAutomaticTest.ShowResultDialog(const ATitle, AInstructions: string
|
||||||
|
): Boolean;
|
||||||
|
begin
|
||||||
|
Result := Application.MessageBox(PChar(AInstructions), PChar(ATitle), MB_YESNO) = IDYES;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -31,11 +31,13 @@ var
|
|||||||
PrimaryConfigPath: string;
|
PrimaryConfigPath: string;
|
||||||
BugsTestSuite: TTestSuite;
|
BugsTestSuite: TTestSuite;
|
||||||
LCLTestSuite: TTestSuite;
|
LCLTestSuite: TTestSuite;
|
||||||
|
SemiAutoTestSuite: TTestSuite;
|
||||||
|
|
||||||
// reads the output from a process and puts it in a memory stream
|
// reads the output from a process and puts it in a memory stream
|
||||||
function ReadOutput(AProcess:TProcess): TStringList;
|
function ReadOutput(AProcess:TProcess): TStringList;
|
||||||
procedure AddToBugsTestSuite(ATest: TTest);
|
procedure AddToBugsTestSuite(ATest: TTest);
|
||||||
procedure AddToLCLTestSuite(ATestClass: TClass);
|
procedure AddToLCLTestSuite(ATestClass: TClass);
|
||||||
|
procedure AddToSemiAutoTestSuite(ATestClass: TClass);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -98,12 +100,19 @@ begin
|
|||||||
LCLTestSuite.AddTestSuiteFromClass(ATestClass);
|
LCLTestSuite.AddTestSuiteFromClass(ATestClass);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure AddToSemiAutoTestSuite(ATestClass: TClass);
|
||||||
|
begin
|
||||||
|
SemiAutoTestSuite.AddTestSuiteFromClass(ATestClass);
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
GetTestRegistry.TestName := 'All tests';
|
GetTestRegistry.TestName := 'All tests';
|
||||||
BugsTestSuite := TTestSuite.Create('Bugs');
|
BugsTestSuite := TTestSuite.Create('Bugs');
|
||||||
GetTestRegistry.AddTest(BugsTestSuite);
|
GetTestRegistry.AddTest(BugsTestSuite);
|
||||||
LCLTestSuite := TTestSuite.Create('LCL tests');
|
LCLTestSuite := TTestSuite.Create('LCL tests');
|
||||||
GetTestRegistry.AddTest(LCLTestSuite);
|
GetTestRegistry.AddTest(LCLTestSuite);
|
||||||
|
SemiAutoTestSuite := TTestSuite.Create('Semi Automatic tests');
|
||||||
|
GetTestRegistry.AddTest(SemiAutoTestSuite);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -30,7 +30,9 @@ uses
|
|||||||
TestLpi, BugTestCase,
|
TestLpi, BugTestCase,
|
||||||
bug8432, testfileutil, testfileproc,
|
bug8432, testfileutil, testfileproc,
|
||||||
// lcltests
|
// lcltests
|
||||||
testunicode, testpen;
|
testunicode, testpen,
|
||||||
|
// semi-automatic tests
|
||||||
|
semiautotests, idesemiautotests;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user