[Interest] Unit testing: any best-practices tips ?

David Heremans david.heremans at intersoft-electronics.com
Tue Dec 13 15:08:24 CET 2011


Hello,

So far I have used Qt in its most simple form. => one *.pro file to
generate one executable.
I've been reading about unit testing with qtestlib, but apparently for
each unit test one should build its own executable etc etc.

But how is this best implement in practice ?
    a) copy around all the code you want to test in different
directories and create a separate project for each test? This seems like
a bad idea, I guess those files will be out of sync in a the shortest
possible amount of time.
    b) Create several *.pro files in you project directory tree, one for
the project itself and one for each unit test?
    c) Is it possible to have multiple targets in one pro file ? (And if
so is this a Good Idea(TM)?)

Can anybody give me some good advice on how to continue? Are there any
good "DO's and DON'TS"  articles out there?

Any hints will be greatly appreciated.
Thanks.

David H




More information about the Interest mailing list