mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 20:38:15 +02:00
FPCUnit: Add Next failure / Previous failure controls for GUI test runner. Issue #22975, patch from jacobb.
git-svn-id: trunk@49690 -
This commit is contained in:
parent
5d3813ec5f
commit
6d35e05ae3
@ -4,7 +4,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Top = 123
|
Top = 123
|
||||||
Width = 575
|
Width = 575
|
||||||
Caption = 'FPCUnit - run unit tests'
|
Caption = 'FPCUnit - run unit tests'
|
||||||
ClientHeight = 636
|
ClientHeight = 643
|
||||||
ClientWidth = 575
|
ClientWidth = 575
|
||||||
Constraints.MinHeight = 200
|
Constraints.MinHeight = 200
|
||||||
Constraints.MinWidth = 250
|
Constraints.MinWidth = 250
|
||||||
@ -103,20 +103,20 @@ object GUITestRunner: TGUITestRunner
|
|||||||
end
|
end
|
||||||
object Panel2: TPanel
|
object Panel2: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 556
|
Height = 563
|
||||||
Top = 80
|
Top = 80
|
||||||
Width = 575
|
Width = 575
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
Caption = 'Panel2'
|
Caption = 'Panel2'
|
||||||
ClientHeight = 556
|
ClientHeight = 563
|
||||||
ClientWidth = 575
|
ClientWidth = 575
|
||||||
FullRepaint = False
|
FullRepaint = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
TabStop = True
|
TabStop = True
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 556
|
Height = 563
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 575
|
Width = 575
|
||||||
ActivePage = tsTestTree
|
ActivePage = tsTestTree
|
||||||
@ -126,17 +126,18 @@ object GUITestRunner: TGUITestRunner
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object tsTestTree: TTabSheet
|
object tsTestTree: TTabSheet
|
||||||
Caption = 'Testcase tree'
|
Caption = 'Testcase tree'
|
||||||
ClientHeight = 529
|
ClientHeight = 535
|
||||||
ClientWidth = 571
|
ClientWidth = 567
|
||||||
object TestTree: TTreeView
|
object TestTree: TTreeView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 317
|
Height = 323
|
||||||
Top = 3
|
Top = 3
|
||||||
Width = 571
|
Width = 567
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 3
|
||||||
BackgroundColor = clBtnFace
|
BackgroundColor = clBtnFace
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
|
DefaultItemHeight = 18
|
||||||
Images = TestTreeImageList
|
Images = TestTreeImageList
|
||||||
PopupMenu = PopupResults
|
PopupMenu = PopupResults
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
@ -154,16 +155,16 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Cursor = crVSplit
|
Cursor = crVSplit
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 5
|
Height = 5
|
||||||
Top = 320
|
Top = 326
|
||||||
Width = 571
|
Width = 567
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
ResizeAnchor = akBottom
|
ResizeAnchor = akBottom
|
||||||
end
|
end
|
||||||
object MemoDetails: TMemo
|
object MemoDetails: TMemo
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 97
|
Height = 97
|
||||||
Top = 432
|
Top = 438
|
||||||
Width = 571
|
Width = 567
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
PopupMenu = PopupDetails
|
PopupMenu = PopupDetails
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
@ -174,16 +175,16 @@ object GUITestRunner: TGUITestRunner
|
|||||||
Cursor = crVSplit
|
Cursor = crVSplit
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 5
|
Height = 5
|
||||||
Top = 427
|
Top = 433
|
||||||
Width = 571
|
Width = 567
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
ResizeAnchor = akBottom
|
ResizeAnchor = akBottom
|
||||||
end
|
end
|
||||||
object MemoLog: TMemo
|
object MemoLog: TMemo
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 102
|
Height = 102
|
||||||
Top = 325
|
Top = 331
|
||||||
Width = 571
|
Width = 567
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
ScrollBars = ssAutoBoth
|
ScrollBars = ssAutoBoth
|
||||||
@ -213,7 +214,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
BookMarkOptions.Xoffset = -18
|
BookMarkOptions.Xoffset = -18
|
||||||
Gutter.Visible = False
|
Gutter.Visible = False
|
||||||
Gutter.Width = 57
|
Gutter.Width = 59
|
||||||
Gutter.MouseActions = <
|
Gutter.MouseActions = <
|
||||||
item
|
item
|
||||||
ClickCount = ccAny
|
ClickCount = ccAny
|
||||||
@ -652,7 +653,7 @@ object GUITestRunner: TGUITestRunner
|
|||||||
MouseActions = <>
|
MouseActions = <>
|
||||||
end
|
end
|
||||||
object TSynGutterLineNumber
|
object TSynGutterLineNumber
|
||||||
Width = 17
|
Width = 19
|
||||||
MouseActions = <>
|
MouseActions = <>
|
||||||
MarkupInfo.Background = clBtnFace
|
MarkupInfo.Background = clBtnFace
|
||||||
MarkupInfo.Foreground = clNone
|
MarkupInfo.Foreground = clNone
|
||||||
@ -1816,6 +1817,16 @@ object GUITestRunner: TGUITestRunner
|
|||||||
OnExecute = ActSaveResultsExecute
|
OnExecute = ActSaveResultsExecute
|
||||||
ShortCut = 16467
|
ShortCut = 16467
|
||||||
end
|
end
|
||||||
|
object actNextError: TAction
|
||||||
|
Caption = 'Next error'
|
||||||
|
OnExecute = actNextErrorExecute
|
||||||
|
ShortCut = 16462
|
||||||
|
end
|
||||||
|
object actPrevError: TAction
|
||||||
|
Caption = 'Previous error'
|
||||||
|
OnExecute = actPrevErrorExecute
|
||||||
|
ShortCut = 16464
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object PopupResults: TPopupMenu
|
object PopupResults: TPopupMenu
|
||||||
Images = MainImageList
|
Images = MainImageList
|
||||||
@ -1970,6 +1981,12 @@ object GUITestRunner: TGUITestRunner
|
|||||||
}
|
}
|
||||||
OnClick = ActRunHighlightedTestExecute
|
OnClick = ActRunHighlightedTestExecute
|
||||||
end
|
end
|
||||||
|
object MenuItem22: TMenuItem
|
||||||
|
Action = actNextError
|
||||||
|
end
|
||||||
|
object MenuItem23: TMenuItem
|
||||||
|
Action = actPrevError
|
||||||
|
end
|
||||||
object MenuItem5: TMenuItem
|
object MenuItem5: TMenuItem
|
||||||
Action = ActCheckAll
|
Action = ActCheckAll
|
||||||
OnClick = ActCheckAllExecute
|
OnClick = ActCheckAllExecute
|
||||||
@ -2284,6 +2301,12 @@ object GUITestRunner: TGUITestRunner
|
|||||||
FF00FFFFFF00FFFFFF00
|
FF00FFFFFF00FFFFFF00
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
object MenuItem20: TMenuItem
|
||||||
|
Action = actNextError
|
||||||
|
end
|
||||||
|
object MenuItem21: TMenuItem
|
||||||
|
Action = actPrevError
|
||||||
|
end
|
||||||
object MenuItem13: TMenuItem
|
object MenuItem13: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
|
@ -102,6 +102,12 @@ type
|
|||||||
tsTestTree: TTabSheet;
|
tsTestTree: TTabSheet;
|
||||||
tsResultsXML: TTabSheet;
|
tsResultsXML: TTabSheet;
|
||||||
XMLSynEdit: TSynEdit;
|
XMLSynEdit: TSynEdit;
|
||||||
|
actNextError: TAction;
|
||||||
|
MenuItem20: TMenuItem;
|
||||||
|
actPrevError: TAction;
|
||||||
|
MenuItem21: TMenuItem;
|
||||||
|
MenuItem22: TMenuItem;
|
||||||
|
MenuItem23: TMenuItem;
|
||||||
procedure ActCheckAllExecute(Sender: TObject);
|
procedure ActCheckAllExecute(Sender: TObject);
|
||||||
procedure ActCheckCurrentSuiteExecute(Sender: TObject);
|
procedure ActCheckCurrentSuiteExecute(Sender: TObject);
|
||||||
procedure ActCloseFormExecute(Sender: TObject);
|
procedure ActCloseFormExecute(Sender: TObject);
|
||||||
@ -127,6 +133,8 @@ type
|
|||||||
procedure ActCopyErrorMsgExecute(Sender: TObject);
|
procedure ActCopyErrorMsgExecute(Sender: TObject);
|
||||||
procedure ActCopyErrorMsgUpdate(Sender: TObject);
|
procedure ActCopyErrorMsgUpdate(Sender: TObject);
|
||||||
procedure pbBarPaint(Sender: TObject);
|
procedure pbBarPaint(Sender: TObject);
|
||||||
|
procedure actNextErrorExecute(Sender: TObject);
|
||||||
|
procedure actPrevErrorExecute(Sender: TObject);
|
||||||
private
|
private
|
||||||
failureCounter: Integer;
|
failureCounter: Integer;
|
||||||
errorCounter: Integer;
|
errorCounter: Integer;
|
||||||
@ -159,6 +167,8 @@ type
|
|||||||
procedure RunTest(ATest: TTest);
|
procedure RunTest(ATest: TTest);
|
||||||
procedure StartTestSuite(ATestSuite: TTestSuite);
|
procedure StartTestSuite(ATestSuite: TTestSuite);
|
||||||
procedure EndTestSuite(ATestSuite: TTestSuite);
|
procedure EndTestSuite(ATestSuite: TTestSuite);
|
||||||
|
procedure NextError;
|
||||||
|
procedure PrevError;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -615,6 +625,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGUITestRunner.actNextErrorExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
NextError;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TGUITestRunner.actPrevErrorExecute(Sender: TObject);
|
||||||
|
begin
|
||||||
|
PrevError;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TGUITestRunner.BuildTree(rootNode: TTreeNode; aSuite: TTestSuite);
|
procedure TGUITestRunner.BuildTree(rootNode: TTreeNode; aSuite: TTestSuite);
|
||||||
var
|
var
|
||||||
@ -1013,6 +1033,42 @@ begin
|
|||||||
PaintNodeNonFailed(Node);
|
PaintNodeNonFailed(Node);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGUITestRunner.NextError;
|
||||||
|
var
|
||||||
|
Node: TTreeNode;
|
||||||
|
begin
|
||||||
|
Node := TestTree.Selected;
|
||||||
|
while Assigned(Node) do
|
||||||
|
begin
|
||||||
|
Node := Node.GetNext;
|
||||||
|
if Assigned(Node) and (Node.ImageIndex in [imgRedBall, imgPurpleBall]) and
|
||||||
|
(TObject(Node.Data) is TTestCase) then
|
||||||
|
begin
|
||||||
|
TestTree.Selected := Node;
|
||||||
|
TestTree.MakeSelectionVisible;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TGUITestRunner.PrevError;
|
||||||
|
var
|
||||||
|
Node: TTreeNode;
|
||||||
|
begin
|
||||||
|
Node := TestTree.Selected;
|
||||||
|
while Assigned(Node) do
|
||||||
|
begin
|
||||||
|
Node := Node.GetPrev;
|
||||||
|
if Assigned(Node) and (Node.ImageIndex in [imgRedBall, imgPurpleBall]) and
|
||||||
|
(TObject(Node.Data) is TTestCase) then
|
||||||
|
begin
|
||||||
|
TestTree.Selected := Node;
|
||||||
|
TestTree.MakeSelectionVisible;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TranslateResStrings;
|
procedure TranslateResStrings;
|
||||||
var
|
var
|
||||||
Lang, FallbackLang, S: String;
|
Lang, FallbackLang, S: String;
|
||||||
|
Loading…
Reference in New Issue
Block a user