Re: [TFUI] testing Qt code

David Dibben <dibben-duq3b/zSlLYXvkv/[email protected]>
Newsgroups gmane.comp.programming.test-first-user-interfaces
Organization The Japan Research Institute, Ltd.
Message-ID <[email protected]>
On Wed, 12 May 2004 07:32:33 -0000
"dammak rafik" <[email protected]> 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
threads or to edit the source of QtTestRunner to disable the threading.

Regards

David


To unsubscribe, email:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/TestFirstUserInterfaces/

<*> To unsubscribe from this group, send an email to:
     TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.