#include <TesterApplication.h> [code]
Inherits QCoreApplication.
Inheritance diagram for Utils::CalitkoMocks::TesterApplication:


QCoreApplication::exec() is not supposed to be interrupted by unhandled exceptions, however, we will throw CppUnit exceptions from within QCoreApplication::processEvents() if a test that needs the event loop fails.
We solve the problem by reimplementing notify() to catch all CppUnit exceptions, store them and exit(1) the event loop. Our new implementation of exec() checks the stored exception and rethrows it so that CppUnit can report the failed test.
Definition at line 45 of file TesterApplication.h.
Public Member Functions | |
| TesterApplication (int &argc, char **argv) | |
| bool | notify (QObject *receiver, QEvent *event) |
| Adds exception handling to QCoreApplication::notify(). | |
Static Public Member Functions | |
| static int | exec (int maxTime) |
| Executes the application main loop and rethrows CppUnit exceptions. | |
Private Slots | |
| void | timeout () |
Private Attributes | |
| auto_ptr< CPPUNIT_NS::Exception > | cppUnitException |
| QTimer | timeoutTimer |
|
||||||||||||
|
Definition at line 27 of file TesterApplication.cpp. |
|
|
Executes the application main loop and rethrows CppUnit exceptions.
Definition at line 36 of file TesterApplication.cpp. |
|
||||||||||||
|
Adds exception handling to QCoreApplication::notify().
Definition at line 63 of file TesterApplication.cpp. |
|
|
Definition at line 74 of file TesterApplication.cpp. |
|
|
Definition at line 58 of file TesterApplication.h. |
|
|
Definition at line 59 of file TesterApplication.h. |