12 May 2004 11:43
Re: [TFUI] testing Qt code
On Wed, 12 May 2004 07:32:33 -0000 "dammak rafik" <medrafik2000@...> wrote: > My question is about : how I must do to respect the test driven > development in the case of Qt library for GUI.I have found two test > tools(not free) :squish (froglogic.com) and Kdexucator(ics.com).I had > found also Qtunit but it is old version and hadn't be update since two > years. As I understand it Qtunit is basically just a GUI for running CppUnit tests (plus a few other features.) The current version of CppUnit also comes with QtTestRunner which is another Qt GUI for running the unit tests. A couple of points about these 1) You don't need to use these to use CppUnit with Qt. I generally use the text version of the test runner. However, you do need to create a QApplication object somewhere before using any of the Qt widgets. 2) You can't use QtTestRunner, as it ships, with CppUnit when running GUI tests. The problem is that QtTestRunner runs each test in a separate thread. This makes the test runner GUI nice and responsive during the test run but if you try to create some of the Qt widgets, such as QListView which generate events in your test then on windows your tests will crash. The problem is that Qt widgets must be created in the main thread, so if they are created in your test which is running in a separate thread then at best you get undefined/unexpected behaviour (Unix) or it just crashes (Windows). The solution is either to use the text test runner which does not use(Continue reading)
RSS Feed