Hello everyone !

I'm a in a professionnal licence (France) and i have issue on my tutored project.
I have a big problem on the Qt test framework and online tutorials I find didn't help me at all ... All take for exemple the ToUpper() method test, but the issue is because i didn't find how to use this freaking tests on my own classes ! T-T
I've some questions on QT Test:
-> do I made a .cpp and a .h for my test class ? Or putting all on the .cpp ?
-> I my class need to be in antoher project ? Or in the same project ? If i need to make another project, how to link both ?
-> do i need to importe .cpp of the class i need to test or the .h ? Or both maybe ?

This i the code of my test class:

Qt Code:
  1. #include <QString>
  2. #include <QtTest>
  3. #include "carre.h"
  4. #include "cercle.h"
  5. #include "point.h"
  6. #include "rectangle.h"
  7. #include "segment.h"
  8. #include "figure.h"
  9. #include "position.h"
  10.  
  11. class TestsProjetTest : public QObject
  12. {
  13. Q_OBJECT
  14.  
  15. public:
  16. TestsProjetTest();
  17. Carre* c;
  18. Position* p;
  19.  
  20. private Q_SLOTS:
  21. void testDeplacement();
  22. };
  23.  
  24. TestsProjetTest::TestsProjetTest()
  25. {
  26. c = new Carre();
  27. p = new Position(10, 10);
  28. }
  29.  
  30. void TestsProjetTest::testDeplacement()
  31. {
  32. QVERIFY2(true, "Failure");
  33. }
  34.  
  35. QTEST_APPLESS_MAIN(TestsProjetTest)
  36.  
  37. #include "tst_testsprojettest.moc"
To copy to clipboard, switch view to plain text mode 
It's really a simple code which actually don't test anything, but i've some issues i didn't understand what can I do... There are the issues:
Qt Code:
  1. error: undefined reference to `Carre::Carre()'
  2. error: undefined reference to `Position::Position(int, int)'
  3. :-1: error: collect2: error: ld returned 1 exit status
To copy to clipboard, switch view to plain text mode 

It's really strange because methods work pretty well in my project and don't have any problems... I put NameOfMyClass:: for each method on my project, and it work ! So i don't understand why i have problems like that ...

I have there problems for one week and i didn't find a solution ... I really need help

And please, dont redirect me on the ToUpper() tuto you find on Qt doc because i didn't help me at all !
Same thing for the tuto on developpez.net

I hope you will find the problem and explain to me how to use Qt test framework ! I really need to improve my skill on it, because Qt will be my professionnal IDE, so i need to learn many things !

Thanks by advance !

Axel.