PDA

View Full Version : Integrating QtTest with CMake



chiiph
28th October 2010, 01:00
Hello everyone,

I'm trying to build unit tests for an application I'm doing. The build system is CMake, but I can't find much docs about QtTest integration with it.

Is that that I just need to build each test as an independent app, make the build script for each one, tell the general CMakeLists that it needs to build those, and then use:
add_test(src/tests/SomeModule/test_app) ?

Thanks in advance,
Tomas

ChrisW67
28th October 2010, 06:54
Is that that I just need to build each test as an independent app,

That's how it works in using the Qt Test Library in general.

make the build script for each one, tell the general CMakeLists that it needs to build those,

Yes.
[/quote]and then use:
add_test(src/tests/SomeModule/test_app) ?
[/QUOTE]
This is CMake specific. I don't know what it does. If it just adds another executable to a "test" target then this is probably useful.

chiiph
28th October 2010, 11:36
Ok, thanks, I'll give it a try...