How to create and execute tests with CMake

2011-01-27 Thread Riccardo Bellini
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. 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. Thank you very much, Riccardo >> Vi

Re: How to create and execute tests with CMake

2011-01-27 Thread Andreas Pakulat
On 27.01.11 22:56:05, 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. > I need to know in particular what commands do I have to use, just a simple > example of how to create a test executable f

Re: How to create and execute tests with CMake

2011-01-27 Thread Valentin Rusu
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 c

Re: How to create and execute tests with CMake

2011-01-28 Thread Andreas Pakulat
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 command

Re: How to create and execute tests with CMake

2011-01-28 Thread Milian Wolff
On 01/28/11 08:59, Andreas Pakulat wrote: > 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 :)

Re: How to create and execute tests with CMake

2011-01-28 Thread Riccardo Bellini
Thank you all for your replies, however I would prefer using Qt functions rather than kde4_add_unit_test. I finally got it to work, but I had to split the test class in .h and .cpp files, and call qt_wrap_cpp on header file, including mocs in sources when I call add_executable. Another question: it

Re: How to create and execute tests with CMake

2011-01-28 Thread Valentin Rusu
> 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. Oh, quite a handy macro ! I'll definitely try it out ! Valentin >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub

Re: How to create and execute tests with CMake

2011-01-28 Thread Andreas Pakulat
On 28.01.11 13:13:58, Riccardo Bellini wrote: > Thank you all for your replies, however I would prefer using Qt functions > rather than kde4_add_unit_test. > I finally got it to work, but I had to split the test class in .h and .cpp > files, and call qt_wrap_cpp on header file, including mocs in so

Re: How to create and execute tests with CMake

2011-01-28 Thread Valentin Rusu
On 01/28/2011 01:13 PM, Riccardo Bellini wrote: > Thank you all for your replies, however I would prefer using Qt > functions rather than kde4_add_unit_test. > I finally got it to work, but I had to split the test class in .h and > .cpp files, and call qt_wrap_cpp on header file, including mocs in

Re: How to create and execute tests with CMake

2011-01-29 Thread Riccardo Bellini
Hmmm, I have tried your solution (also including myfile.moc at the end of the .cpp file), but it complains about undefined references to vtable and it does not compile... A question related to compile the sources into the test executable: can I use a variable created in a "parent" of the cmake file

Re: How to create and execute tests with CMake

2011-01-29 Thread Valentin Rusu
On 01/29/2011 06:50 PM, Riccardo Bellini wrote: > Hmmm, I have tried your solution (also including myfile.moc at the end > of the .cpp file), but it complains about undefined references to > vtable and it does not compile... > A question related to compile the sources into the test executable: > ca

Re: How to create and execute tests with CMake

2011-01-29 Thread Andreas Pakulat
On 29.01.11 18:50:14, Riccardo Bellini wrote: > Hmmm, I have tried your solution (also including myfile.moc at the end of > the .cpp file), but it complains about undefined references to vtable and it > does not compile... Ah, sorry, just re-read the qt4_automoc code, it indeed does not support QO

Re: How to create and execute tests with CMake

2011-01-30 Thread Riccardo Bellini
Ok, it's not a problem :) Thank you all for your help! Riccardo 2011/1/29 Andreas Pakulat > > > Ah, sorry, just re-read the qt4_automoc code, it indeed does not support > QObject in .cpp files. Sorry about the confusion. Indeed I now recall > that the Qt4 CMake macro's don't support QObject clas