mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-24 16:56:34 +02:00
added command line parameter for running test at startup from Dean
git-svn-id: trunk@6672 -
This commit is contained in:
parent
47ab7292d7
commit
439830118d
@ -21,15 +21,17 @@ object GUITestRunner: TGUITestRunner
|
|||||||
}
|
}
|
||||||
OnCreate = GUITestRunnerCreate
|
OnCreate = GUITestRunnerCreate
|
||||||
OnDestroy = GUITestRunnerDestroy
|
OnDestroy = GUITestRunnerDestroy
|
||||||
|
OnShow = GUITestRunnerShow
|
||||||
PixelsPerInch = 95
|
PixelsPerInch = 95
|
||||||
HorzScrollBar.Page = 647
|
HorzScrollBar.Page = 645
|
||||||
VertScrollBar.Page = 713
|
VertScrollBar.Page = 711
|
||||||
Left = 372
|
Left = 372
|
||||||
Height = 712
|
Height = 712
|
||||||
Top = 142
|
Top = 142
|
||||||
Width = 646
|
Width = 646
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Align = alTop
|
Align = alTop
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
ClientHeight = 82
|
ClientHeight = 82
|
||||||
ClientWidth = 646
|
ClientWidth = 646
|
||||||
FullRepaint = False
|
FullRepaint = False
|
||||||
@ -37,7 +39,17 @@ object GUITestRunner: TGUITestRunner
|
|||||||
TabStop = True
|
TabStop = True
|
||||||
Height = 82
|
Height = 82
|
||||||
Width = 646
|
Width = 646
|
||||||
|
object Label1: TLabel
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
|
Caption = 'Selected Test Suite:'
|
||||||
|
ParentColor = True
|
||||||
|
Left = 160
|
||||||
|
Height = 17
|
||||||
|
Top = 16
|
||||||
|
Width = 176
|
||||||
|
end
|
||||||
object btnRun: TBitBtn
|
object btnRun: TBitBtn
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
Caption = '&Run'
|
Caption = '&Run'
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
191C00002F2A2058504D202A2F0A7374617469632063686172202A2062746E5F
|
191C00002F2A2058504D202A2F0A7374617469632063686172202A2062746E5F
|
||||||
@ -274,6 +286,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Width = 103
|
Width = 103
|
||||||
end
|
end
|
||||||
object btnClose: TBitBtn
|
object btnClose: TBitBtn
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
Caption = '&Exit'
|
Caption = '&Exit'
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
B42500002F2A2058504D202A2F0A7374617469632063686172202A2065786974
|
B42500002F2A2058504D202A2F0A7374617469632063686172202A2065786974
|
||||||
@ -586,20 +599,13 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Top = 15
|
Top = 15
|
||||||
Width = 96
|
Width = 96
|
||||||
end
|
end
|
||||||
object Label1: TLabel
|
|
||||||
Caption = 'Selected Test Suite:'
|
|
||||||
Left = 160
|
|
||||||
Height = 17
|
|
||||||
Top = 16
|
|
||||||
Width = 176
|
|
||||||
end
|
|
||||||
object ComboBox1: TComboBox
|
object ComboBox1: TComboBox
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'All'
|
'All'
|
||||||
)
|
)
|
||||||
MaxLength = 0
|
MaxLength = 0
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 3
|
|
||||||
Text = 'All'
|
Text = 'All'
|
||||||
Left = 160
|
Left = 160
|
||||||
Height = 21
|
Height = 21
|
||||||
@ -609,6 +615,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
end
|
end
|
||||||
object Panel2: TPanel
|
object Panel2: TPanel
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
Caption = 'Panel2'
|
Caption = 'Panel2'
|
||||||
ClientHeight = 630
|
ClientHeight = 630
|
||||||
ClientWidth = 646
|
ClientWidth = 646
|
||||||
@ -621,6 +628,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
ActivePage = tsTestTree
|
ActivePage = tsTestTree
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
TabIndex = 0
|
TabIndex = 0
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Left = 1
|
Left = 1
|
||||||
@ -637,8 +645,10 @@ object GUITestRunner: TGUITestRunner
|
|||||||
object TestTree: TTreeView
|
object TestTree: TTreeView
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoExpand = True
|
AutoExpand = True
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
BackgroundColor = clBtnFace
|
BackgroundColor = clBtnFace
|
||||||
DefaultItemHeight = 17
|
ChangeDelay = 1
|
||||||
|
DefaultItemHeight = 16
|
||||||
Images = ImageList1
|
Images = ImageList1
|
||||||
ParentCtl3D = False
|
ParentCtl3D = False
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
@ -651,6 +661,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
end
|
end
|
||||||
object Panel4: TPanel
|
object Panel4: TPanel
|
||||||
Align = alTop
|
Align = alTop
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
ClientHeight = 63
|
ClientHeight = 63
|
||||||
ClientWidth = 644
|
ClientWidth = 644
|
||||||
FullRepaint = False
|
FullRepaint = False
|
||||||
@ -658,6 +669,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Height = 63
|
Height = 63
|
||||||
Width = 644
|
Width = 644
|
||||||
object pbBar: TPaintBox
|
object pbBar: TPaintBox
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
ParentColor = True
|
ParentColor = True
|
||||||
OnPaint = pbBarPaint
|
OnPaint = pbBarPaint
|
||||||
Left = 22
|
Left = 22
|
||||||
@ -680,8 +692,9 @@ object GUITestRunner: TGUITestRunner
|
|||||||
end
|
end
|
||||||
object Memo1: TMemo
|
object Memo1: TMemo
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
PopupMenu = PopupMenu2
|
PopupMenu = PopupMenu2
|
||||||
TabOrder = 3
|
TabOrder = 2
|
||||||
Height = 53
|
Height = 53
|
||||||
Top = 553
|
Top = 553
|
||||||
Width = 644
|
Width = 644
|
||||||
@ -696,6 +709,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Width = 644
|
Width = 644
|
||||||
object Panel3: TPanel
|
object Panel3: TPanel
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
Caption = 'Panel3'
|
Caption = 'Panel3'
|
||||||
ClientHeight = 606
|
ClientHeight = 606
|
||||||
ClientWidth = 644
|
ClientWidth = 644
|
||||||
@ -706,6 +720,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Width = 644
|
Width = 644
|
||||||
object Panel5: TPanel
|
object Panel5: TPanel
|
||||||
Align = alTop
|
Align = alTop
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
BorderWidth = 1
|
BorderWidth = 1
|
||||||
ClientHeight = 58
|
ClientHeight = 58
|
||||||
ClientWidth = 642
|
ClientWidth = 642
|
||||||
@ -717,6 +732,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Width = 642
|
Width = 642
|
||||||
object SpeedButton1: TSpeedButton
|
object SpeedButton1: TSpeedButton
|
||||||
Action = actCopy
|
Action = actCopy
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
Flat = True
|
Flat = True
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
880D00002F2A2058504D202A2F0A7374617469632063686172202A2065646974
|
880D00002F2A2058504D202A2F0A7374617469632063686172202A2065646974
|
||||||
@ -840,6 +856,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
end
|
end
|
||||||
object SpeedButton2: TSpeedButton
|
object SpeedButton2: TSpeedButton
|
||||||
Action = actCut
|
Action = actCut
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
Flat = True
|
Flat = True
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
CC0500002F2A2058504D202A2F0A7374617469632063686172202A2065646974
|
CC0500002F2A2058504D202A2F0A7374617469632063686172202A2065646974
|
||||||
@ -900,6 +917,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Width = 31
|
Width = 31
|
||||||
end
|
end
|
||||||
object pbBar1: TPaintBox
|
object pbBar1: TPaintBox
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
ParentColor = True
|
ParentColor = True
|
||||||
OnPaint = pbBarPaint
|
OnPaint = pbBarPaint
|
||||||
Left = 110
|
Left = 110
|
||||||
@ -910,6 +928,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
end
|
end
|
||||||
object XMLMemo: TMemo
|
object XMLMemo: TMemo
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
BorderSpacing.OnChange = nil
|
||||||
PopupMenu = PopupMenu1
|
PopupMenu = PopupMenu1
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Left = 1
|
Left = 1
|
||||||
@ -1739,8 +1758,8 @@ object GUITestRunner: TGUITestRunner
|
|||||||
end
|
end
|
||||||
object ActionList1: TActionList
|
object ActionList1: TActionList
|
||||||
Images = ImageList2
|
Images = ImageList2
|
||||||
left = 112
|
left = 116
|
||||||
top = 288
|
top = 280
|
||||||
object actCopy: TAction
|
object actCopy: TAction
|
||||||
Hint = 'Copy results to clipboard'
|
Hint = 'Copy results to clipboard'
|
||||||
OnExecute = actCopyExecute
|
OnExecute = actCopyExecute
|
||||||
|
@ -32,6 +32,8 @@ const
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ TGUITestRunner }
|
||||||
|
|
||||||
TGUITestRunner = class(TForm, ITestListener)
|
TGUITestRunner = class(TForm, ITestListener)
|
||||||
actCopy: TAction;
|
actCopy: TAction;
|
||||||
actCut: TAction;
|
actCut: TAction;
|
||||||
@ -66,6 +68,7 @@ type
|
|||||||
procedure BtnCloseClick(Sender: TObject);
|
procedure BtnCloseClick(Sender: TObject);
|
||||||
procedure GUITestRunnerCreate(Sender: TObject);
|
procedure GUITestRunnerCreate(Sender: TObject);
|
||||||
procedure GUITestRunnerDestroy(Sender: TObject);
|
procedure GUITestRunnerDestroy(Sender: TObject);
|
||||||
|
procedure GUITestRunnerShow(Sender: TObject);
|
||||||
procedure MenuItem3Click(Sender: TObject);
|
procedure MenuItem3Click(Sender: TObject);
|
||||||
procedure TestTreeSelectionChanged(Sender: TObject);
|
procedure TestTreeSelectionChanged(Sender: TObject);
|
||||||
procedure pbBarPaint(Sender: TObject);
|
procedure pbBarPaint(Sender: TObject);
|
||||||
@ -80,6 +83,7 @@ type
|
|||||||
errorCounter: Integer;
|
errorCounter: Integer;
|
||||||
testsCounter: Integer;
|
testsCounter: Integer;
|
||||||
barColor: TColor;
|
barColor: TColor;
|
||||||
|
testSuite: TTest;
|
||||||
protected
|
protected
|
||||||
{ IInterface }
|
{ IInterface }
|
||||||
function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
|
function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
|
||||||
@ -131,6 +135,12 @@ begin
|
|||||||
suiteList.Free;
|
suiteList.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGUITestRunner.GUITestRunnerShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if (ParamStr(1) = '--now') or (ParamStr(1) = '-n') then
|
||||||
|
BtnRunClick(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TGUITestRunner.MenuItem3Click(Sender: TObject);
|
procedure TGUITestRunner.MenuItem3Click(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Clipboard.AsText := Memo1.Lines.Text;
|
Clipboard.AsText := Memo1.Lines.Text;
|
||||||
@ -148,14 +158,17 @@ var
|
|||||||
begin
|
begin
|
||||||
with (Sender as TPaintBox) do
|
with (Sender as TPaintBox) do
|
||||||
begin
|
begin
|
||||||
Canvas.Brush.Color := clGray;
|
Canvas.Brush.Color := clSilver;
|
||||||
Canvas.Rectangle(0, 0, Width, Height);
|
Canvas.Rectangle(0, 0, Width, Height);
|
||||||
if (FailureCounter = 0) and (ErrorCounter = 0) then
|
if Assigned(TestSuite) then
|
||||||
|
begin
|
||||||
|
if (FailureCounter = 0) and (ErrorCounter = 0) and
|
||||||
|
(TestsCounter = TestSuite.CountTestCases) then
|
||||||
barColor := clGreen;
|
barColor := clGreen;
|
||||||
Canvas.Brush.Color := barColor;
|
Canvas.Brush.Color := barColor;
|
||||||
if TestsCounter <> 0 then
|
if TestsCounter <> 0 then
|
||||||
begin
|
begin
|
||||||
Canvas.Rectangle(0, 0, round(TestsCounter / GetTestRegistry.CountTestCases * Width), Height);
|
Canvas.Rectangle(0, 0, round(TestsCounter / TestSuite.CountTestCases * Width), Height);
|
||||||
Canvas.Font.Color := clWhite;
|
Canvas.Font.Color := clWhite;
|
||||||
msg := 'Runs: ' + IntToStr(TestsCounter);
|
msg := 'Runs: ' + IntToStr(TestsCounter);
|
||||||
if ErrorCounter <> 0 then
|
if ErrorCounter <> 0 then
|
||||||
@ -165,13 +178,14 @@ begin
|
|||||||
Canvas.Textout(10, 10, msg)
|
Canvas.Textout(10, 10, msg)
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGUITestRunner.btnRunClick(Sender: TObject);
|
procedure TGUITestRunner.btnRunClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
testResult: TTestResult;
|
testResult: TTestResult;
|
||||||
testSuite: TTest;
|
|
||||||
begin
|
begin
|
||||||
|
barcolor := clGray;
|
||||||
TestTree.items.Clear;
|
TestTree.items.Clear;
|
||||||
suiteList.Clear;
|
suiteList.Clear;
|
||||||
currentTestNode := nil;
|
currentTestNode := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user