1 qautotestgenerator is a tool to generate stub tests for a C++ class. When writing tests for new code one of the more annoying parts is getting the initial file up and running. qautotestgenerator helps by automatically creating quite a bit of stub code after which you just go through the file filling it in with the actual tests.
4 - Creates a stub tests for each non private function in the class.
5 - Creates a subclass for the class to expose any protected functions for testing.
6 - Creates a basic sanity test that just calls each function.
7 - Creates a _data() function for each test.
8 - Populates the _data() functions with columns for each argument and the return value.
9 - Adds QFETCH stub code that matches the generated _data function as a place to start from.
10 - Adds the four init and cleanup functions with documentation so you don't have to look up what does what.
11 - Adds signal spys to each tests if the class contains any signals.
13 To find out more about QTestLib check out its documentation at http://doc.trolltech.com/4.3/qtestlib-manual.html
19 qautotestgenerator requires rpp to build so first use git to clone its repository and then you can build.
21 git clone git://repo.or.cz/rpp.git
30 In the example directory is a file example.h that contains a little class. Execute the following to generate and build a test.
32 ./qautotestgenerator example/example.h Example > example/tst_example.cpp
35 echo "CONFIG += qtestlib" >> example.pro