PDA

View Full Version : Unit Test Organisation, and having qmake what I want



jrharshath
15th September 2009, 18:12
Hi,

I'm working on a qt project called xdc. Its source tree looks like this:


/
xdc.pro
xdc/
include/
...
src/
...
test/
include/
...
src/
...

Now, I want to write a project file so that after generating the Makefile, I should be able to compile the test cases simply with a "make test" command.

What should I write in xdc.pro to make it possible?

More generally, how are unit tests organized in a qt project? Is there a specific way to do it?

Thanks

faldzip
15th September 2009, 18:59
i am not sure if it is the best solution but should work:
1. make some pro file for building tests and put it in test/ dir (lets say tests.pro)
2. add to xdc.pro something like this:


mytests.target = test
mytests.commands = cd test && qmake && make
QMAKE_EXTRA_TARGETS += mytests