On 27.01.11 23:14:59, Valentin Rusu wrote:
> On 01/27/2011 10:56 PM, Riccardo Bellini wrote:
> > Hello!
> > I wonder if there is a way to set up and run in CMake one or more test
> > like those created with Qt Unit Test library.
> Yes, there is a way :)
> > I need to know in particular what commands do I have to use, just a
> > simple example of how to create a test executable from a test class.
> Here is the structure of the CMakeLists.txt shown between === lines
> ================
> SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
> 
> INCLUDE_DIRECTORIES (
>    ${KDE4_INCLUDES}
>    ${CMAKE_SOURCE_DIR}
>    ${CMAKE_CURRENT_BINARY_DIR}
> )
> 
> KDE4_ADD_EXECUTABLE (riccardo_test
>    testclass.cpp
> )
> 
> TARGET_LINK_LIBRARIES (riccardo_test
>    ${QT_QTTEST_LIBRARIES}
> )
> 
> ADD_TEST (TestClass riccardo_test)

If you're already using KDE stuff, then you don't need this. There's a
special macro for unit-tests:
kde4_add_unit_test taking a target name and the sources list.

Andreas

-- 
Your boyfriend takes chocolate from strangers.
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to