PDA

View Full Version : QtTest: Unittesting in several classes



Jojo
20th February 2006, 08:18
Hello,

is there a way to declare multiple classes as Qt testclasses? Atm I have to write all unittests in one class, this doesn't scale very vell imo..
Any other way to use more classes?

Thanks for answer :)

wysota
28th September 2006, 08:30
Sure you can. Just don't use QTEST_MAIN() but instead call all test objects one by one yourself. You can check what QTEST_MAIN expands to to provide your own implementation of the main() function.

gavingc
25th August 2009, 13:38
Yes, you can exec each class directly but I find that can be a mission.
Perhaps if you want exact control of the execution order that may be the way to go but unit tests should be standalone anyways so execution order should not be that important.

Instead try qttestutil:
http://el-tramo.be/blog/qttestutil