Starts adding semi-automatic tests

git-svn-id: trunk@27856 -
This commit is contained in:
sekelsenmat 2010-10-25 14:14:56 +00:00
parent b35808d50f
commit 3ea22f0862
7 changed files with 101 additions and 4 deletions

2
.gitattributes vendored
View File

@ -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

View File

@ -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>

View File

@ -23,7 +23,7 @@ program runtestsgui;
uses
Interfaces, Forms,
GuiTestRunner,
testunits;
testunits, idesemiautotests, semiautotest;
begin
Application.Title:='Run Lazarus tests';

View 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.

View 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.

View File

@ -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.

View File

@ -30,7 +30,9 @@ uses
TestLpi, BugTestCase,
bug8432, testfileutil, testfileproc,
// lcltests
testunicode, testpen;
testunicode, testpen,
// semi-automatic tests
semiautotests, idesemiautotests;
implementation