diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-18 14:53:52 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-18 14:53:52 +0000 |
commit | 61979d0237fa5d5a4ed9811acecb36893b32777e (patch) | |
tree | b0f341d82fb36773ac38afdc84833d9c2b7797d9 /examples/apps | |
parent | cfae57647a51dcc760f526085276db45d8ccd885 (diff) | |
download | fpGUI-61979d0237fa5d5a4ed9811acecb36893b32777e.tar.xz |
* GUI Test Runner: The counters are now activated, so you can see the number of tests run, number of errors and number of failures.
Diffstat (limited to 'examples/apps')
-rw-r--r-- | examples/apps/fpcunit/fpg_guitestrunner.pas | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/examples/apps/fpcunit/fpg_guitestrunner.pas b/examples/apps/fpcunit/fpg_guitestrunner.pas index a2fded47..b7003231 100644 --- a/examples/apps/fpcunit/fpg_guitestrunner.pas +++ b/examples/apps/fpcunit/fpg_guitestrunner.pas @@ -52,6 +52,8 @@ type procedure miExpandAll(Sender: TObject); procedure miCollapseNode(Sender: TObject); procedure miExpandNode(Sender: TObject); + procedure ResetCounters; + procedure UpdateCounters; public {@VFD_HEAD_BEGIN: GUITestRunnerForm} bvlTree: TfpgBevel; @@ -120,6 +122,7 @@ begin node.ImageIndex := 3; end; Inc(failureCounter); + UpdateCounters; if errorCounter = 0 then barColor := clFuchsia; // Error color takes preference @@ -165,6 +168,7 @@ begin node.ImageIndex := 2; end; Inc(errorCounter); + UpdateCounters; barColor := clRed; tvTests.Invalidate; @@ -219,11 +223,9 @@ var FStartCrono: TDateTime; begin // Reset counters - failureCounter := 0; - errorCounter := 0; - testsCounter := 0; - skipsCounter := 0; - + ResetCounters; + lblRuns.Text := IntToStr(ATest.CountTestCases); + lTestResult := TTestResult.Create; try lTestResult.AddListener(self); @@ -297,6 +299,7 @@ end; procedure TGUITestRunnerForm.btnClearClicked(Sender: TObject); begin memName1.Lines.Clear; + ResetCounters; // tvTests.RootNode.FindSubNode(@ResetNodeColors); tvTests.RootNode.FirstSubNode.Clear; @@ -327,7 +330,7 @@ end; procedure TGUITestRunnerForm.FindByData(ANode: TfpgTreeNode; var AFound: boolean); begin - writeln('...', ANode.Text); +// writeln('...', ANode.Text); AFound := TTest(ANode.Data) = temptest; // if AFound then // MemoLog('Found Node ' + ANode.Text); @@ -428,6 +431,25 @@ begin tvTests.Selection.Expand; end; +procedure TGUITestRunnerForm.ResetCounters; +begin + lblRuns.Text := '---'; + lblFailures.Text := '---'; + lblErrors.Text := '---'; + failureCounter := 0; + errorCounter := 0; + testsCounter := 0; + skipsCounter := 0; +end; + +procedure TGUITestRunnerForm.UpdateCounters; +begin + lblFailures.Text := IntToStr(failureCounter); + lblErrors.Text := IntToStr(errorCounter); +// testsCounter := 0; +// skipsCounter := 0; +end; + constructor TGUITestRunnerForm.Create(AOwner: TComponent); begin inherited Create(AOwner); |