I previously asked this in the "newbie" forum but got no responses, perhaps it's not a "newbie" question ;-)...

I've got a directory structure like this:
Qt Code:
  1. /proj
  2. proj.pro
  3. main.cpp
  4. /tests
  5. projtests.pro
  6. main.cpp
  7. /data
  8. data.pri
  9. dataclass.h
  10. dataclass.cpp
  11. /tests
  12. datatests.pri
  13. dataclasstests.h
  14. dataclasstests.cpp
To copy to clipboard, switch view to plain text mode 

Every dir has a /tests dir beneath it with tests, and main.pro includes data.pri whereas maintests.pro includes datatests.pri.

The only thing is, I can't figure out how to run tests when set up like this?
The tutorial says you have to do this in your test class:
Qt Code:
  1. QTEST_MAIN(<test class name>)
  2. #include "<test class name>.moc"
To copy to clipboard, switch view to plain text mode 

But as far as I can tell, QTEST_MAIN creates a main function that tests that one class. I'm going to have multiple classes to test, and I want the test main function to live in /proj/tests/main.cpp.

Also the #include "<name>.moc" always shows a warning in QtCreator that the file doesn't exist, although there is no compile-time error.

How do you do this?