mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-24 02:05:55 +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/runtestsgui.lpi 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/testlpi.pas svneol=native#text/plain
|
||||
test/testresult-db/createdb.sql svneol=native#text/plain
|
||||
|
@ -40,7 +40,7 @@
|
||||
<PackageName Value="CodeTools"/>
|
||||
</Item4>
|
||||
</RequiredPackages>
|
||||
<Units Count="9">
|
||||
<Units Count="11">
|
||||
<Unit0>
|
||||
<Filename Value="runtestsgui.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -86,13 +86,23 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestPen"/>
|
||||
</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>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<OtherUnitFiles Value="bugs;lcltests"/>
|
||||
<OtherUnitFiles Value="bugs;lcltests;semiauto"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
|
@ -23,7 +23,7 @@ program runtestsgui;
|
||||
uses
|
||||
Interfaces, Forms,
|
||||
GuiTestRunner,
|
||||
testunits;
|
||||
testunits, idesemiautotests, semiautotest;
|
||||
|
||||
begin
|
||||
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;
|
||||
BugsTestSuite: TTestSuite;
|
||||
LCLTestSuite: TTestSuite;
|
||||
SemiAutoTestSuite: TTestSuite;
|
||||
|
||||
// reads the output from a process and puts it in a memory stream
|
||||
function ReadOutput(AProcess:TProcess): TStringList;
|
||||
procedure AddToBugsTestSuite(ATest: TTest);
|
||||
procedure AddToLCLTestSuite(ATestClass: TClass);
|
||||
procedure AddToSemiAutoTestSuite(ATestClass: TClass);
|
||||
|
||||
implementation
|
||||
|
||||
@ -98,12 +100,19 @@ begin
|
||||
LCLTestSuite.AddTestSuiteFromClass(ATestClass);
|
||||
end;
|
||||
|
||||
procedure AddToSemiAutoTestSuite(ATestClass: TClass);
|
||||
begin
|
||||
SemiAutoTestSuite.AddTestSuiteFromClass(ATestClass);
|
||||
end;
|
||||
|
||||
initialization
|
||||
GetTestRegistry.TestName := 'All tests';
|
||||
BugsTestSuite := TTestSuite.Create('Bugs');
|
||||
GetTestRegistry.AddTest(BugsTestSuite);
|
||||
LCLTestSuite := TTestSuite.Create('LCL tests');
|
||||
GetTestRegistry.AddTest(LCLTestSuite);
|
||||
SemiAutoTestSuite := TTestSuite.Create('Semi Automatic tests');
|
||||
GetTestRegistry.AddTest(SemiAutoTestSuite);
|
||||
|
||||
end.
|
||||
|
||||
|
@ -30,7 +30,9 @@ uses
|
||||
TestLpi, BugTestCase,
|
||||
bug8432, testfileutil, testfileproc,
|
||||
// lcltests
|
||||
testunicode, testpen;
|
||||
testunicode, testpen,
|
||||
// semi-automatic tests
|
||||
semiautotests, idesemiautotests;
|
||||
|
||||
implementation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user