[Qt-interest] Fwd: Project directory tree with test code subtree (TDD)

Islam Samir Badreldin islam.badreldin at gmail.com
Sat Feb 14 20:30:52 CET 2009


ami guru wrote:
> Hello Islam
>
>
> Yes you can configure   the qmake to generate the Makefile the way you 
> want.
>
> you need to go through  the following section
> http://doc.trolltech.com/4.4/qmake-manual.html
>
> And you can also download some free qt application from
>
> http://www.qt-apps.org/
>
>
> to get the feeling of how those projects have been configured, may be 
> a good hint to get started.
>
>
> Hope that helps
>
> Sajjad
Hello Sajjad,

Thank you very much... I went through the 'qmake advanced usage' in the 
qmake documentation. I found a solution. I used:

    OBJECTS += $$system(ls ../cairo_ex/debug/*.o)

where ../cairo_ex/debug/ is the other directory containing the object 
files for the classes I am testing.
It worked except for a linker error... `multiple definition of main'. Of 
course, the other project I am testing is an executable!
So I had to manually add:

    OBJECTS += $$system(ls ../cairo_ex/debug/*.o)
    OBJECTS -= ../cairo_ex/debug/main.o

so that I exclude the main() of the executable under test. It is my 
workaround for now but it doesn't look very elegant! What do you think?

Thank you again...

Regards,
Islam



More information about the Qt-interest-old mailing list