wxTst::InitWxGuiTestSetUp Class Reference

Initialise GUI part of wxWidgets library exactly once before running first GUI test. More...

#include <InitWxGuiTestSetUp.h>

Inheritance diagram for wxTst::InitWxGuiTestSetUp:

Inheritance graph
[legend]
Collaboration diagram for wxTst::InitWxGuiTestSetUp:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 InitWxGuiTestSetUp (CPPUNIT_NS::Test *test)
 Constructor.
virtual void run (CPPUNIT_NS::TestResult *result)
 Do not call TestDecorator::run() directly as parent class TestSetUp.
virtual void RunAsDecorator ()
 Make up for not called TestDecorator::run().
virtual ~InitWxGuiTestSetUp ()
 Destructor.

Protected Member Functions

virtual void setUp ()
 Initialise wxWidgets library GUI part by means of wxEntry().
virtual void tearDown ()
 Try to destruct wxWidgets library initialisation and "test application".


Detailed Description

Initialise GUI part of wxWidgets library exactly once before running first GUI test.

The GUI part of wxWidgets must only be initialised once due to wxWidgets heavy usage of static constructs. This is necessary as well, as CppUnit is text based and a wxWidgets "test application" is required to simulate the "single stepping" through the test case code. Thus, the code flow must be diverted so that the WxGuiTestApp object is in control of the code flow instead of the CppUnit test runner.

Definition at line 36 of file InitWxGuiTestSetUp.h.


Constructor & Destructor Documentation

wxTst::InitWxGuiTestSetUp::InitWxGuiTestSetUp ( CPPUNIT_NS::Test *  test  ) 

Constructor.

Parameters:
test test to decorate

Definition at line 28 of file InitWxGuiTestSetUp.cpp.

wxTst::InitWxGuiTestSetUp::~InitWxGuiTestSetUp (  )  [virtual]

Destructor.

Definition at line 35 of file InitWxGuiTestSetUp.cpp.


Member Function Documentation

void wxTst::InitWxGuiTestSetUp::run ( CPPUNIT_NS::TestResult *  result  )  [virtual]

Do not call TestDecorator::run() directly as parent class TestSetUp.

Override TestSetUp::run() because the flow of control must be diverted due to integrating the CppUnit test runs into a proper wxWidgets application.

Parameters:
result object to save test results

Definition at line 41 of file InitWxGuiTestSetUp.cpp.

References setUp(), and tearDown().

void wxTst::InitWxGuiTestSetUp::RunAsDecorator (  )  [virtual]

Make up for not called TestDecorator::run().

Is called directly or indirectly from WxGuiTestApp::OnRun().

Definition at line 58 of file InitWxGuiTestSetUp.cpp.

void wxTst::InitWxGuiTestSetUp::setUp (  )  [protected, virtual]

Initialise wxWidgets library GUI part by means of wxEntry().

Definition at line 67 of file InitWxGuiTestSetUp.cpp.

References wxTst::WxGuiTestApp::SetTestRunnerProxy().

Referenced by run().

void wxTst::InitWxGuiTestSetUp::tearDown (  )  [protected, virtual]

Try to destruct wxWidgets library initialisation and "test application".

Definition at line 120 of file InitWxGuiTestSetUp.cpp.

Referenced by run().


The documentation for this class was generated from the following files:

wxWidgets Logo Get wxGuiTesting at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Tue Mar 17 17:29:30 2009 for wxGuiTesting by doxygen 1.5.5