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:
/proj
proj.pro
main.cpp
/tests
projtests.pro
main.cpp
/data
data.pri
dataclass.h
dataclass.cpp
/tests
datatests.pri
dataclasstests.h
dataclasstests.cpp
/proj
proj.pro
main.cpp
/tests
projtests.pro
main.cpp
/data
data.pri
dataclass.h
dataclass.cpp
/tests
datatests.pri
dataclasstests.h
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:
QTEST_MAIN(<test class name>)
#include "<test class name>.moc"
QTEST_MAIN(<test class name>)
#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?
Bookmarks