descriptionqtestlib test stub generator
ownerben@meyerhome.net
last changeFri, 4 Apr 2008 10:03:02 +0000 (4 12:03 +0200)
content tags
add:
README
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.

Some features include:
- Creates a stub tests for each non private function in the class.
- Creates a subclass for the class to expose any protected functions for testing.
- Creates a basic sanity test that just calls each function.
- Creates a _data() function for each test.
- Populates the _data() functions with columns for each argument and the return value.
- Adds QFETCH stub code that matches the generated _data function as a place to start from.
- Adds the four init and cleanup functions with documentation so you don't have to look up what does what.
- Adds signal spys to each tests if the class contains any signals.

To find out more about QTestLib check out its documentation at http://doc.trolltech.com/4.3/qtestlib-manual.html

========
BUILDING
========

qautotestgenerator requires rpp to build so first use git to clone its repository and then you can build.

git clone git://repo.or.cz/rpp.git

qmake
make

=======
EXAMPLE
=======

In the example directory is a file example.h that contains a little class.  Execute the following to generate and build a test.

./qautotestgenerator example/example.h Example > example/tst_example.cpp
cd example
qmake -project
echo "CONFIG += qtestlib" >> example.pro
qmake
make
shortlog
2008-04-04 Benjamin C... Various fixesmaster
2008-01-19 Benjamin C... add 2008 to the copyright
2008-01-19 Benjamin C... Don't use QLatin1String which can break compilation
2008-01-17 Benjamin C... update copyright to 2008
2007-12-23 Benjamin C... Qt knows about the type QUrl
2007-12-22 Benjamin C... Qt knows about the type 'QPixmap'
2007-12-22 Benjamin C... In the event that the function doesn't provide an argum...
2007-12-22 Benjamin C... Construct signal spies before calling the function...
2007-12-19 Benjamin Meyer- Use QSkip rather then QVerify(false) at the end of...
2007-11-08 Benjamin C... Add license
2007-11-08 Benjamin MeyerFlesh out the readme file with information links and...
2007-11-08 Benjamin MeyerFix the include file for some cases
2007-11-08 Benjamin MeyerAdd example class that can be used to generate an examp...
2007-11-08 Benjamin MeyerIgnore generated files
2007-11-08 Benjamin MeyerUpdate patch to match new location of the rpp files
2007-11-08 Benjamin MeyerInitial Commit
heads
16 years ago master