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

Scott Aron Bloom Scott.Bloom at onshorecs.com
Tue Dec 13 21:10:07 CET 2011


My recommendation, that I use now...

Swithc from QMake to CMake and use the google test system...

Its 100% integrated into CMake, and it works great with Qt

Scott

-----Original Message-----
From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org
[mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org] On
Behalf Of David Heremans
Sent: Tuesday, December 13, 2011 6:08 AM
To: interest at qt-project.org; qt-interest at qt.nokia.com
Subject: [Interest] Unit testing: any best-practices tips ?

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

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list