You can just create a seciton in you .pro file, something like this:
// project.pro
// some regular stuff
INCLUDEPATH += ...
SOURCES += ..
// etc
// here for testing
test_conf{
TARGET = my_app_test # different app name for testing suite
QT += testlib
SOURCES += test.cpp test2.cpp
HEADERS += test.h ...
... other stuff for tests
}
// project.pro
// some regular stuff
INCLUDEPATH += ...
SOURCES += ..
// etc
// here for testing
test_conf{
TARGET = my_app_test # different app name for testing suite
QT += testlib
SOURCES += test.cpp test2.cpp
HEADERS += test.h ...
... other stuff for tests
}
To copy to clipboard, switch view to plain text mode
Then you can generate makefiles for test with qmake:
qmake -config test_conf
qmake -config test_conf
To copy to clipboard, switch view to plain text mode
After that, simply build the project as usual. Instead of your regular target, a my_app_test.exe will be created, using your test sources.
Bookmarks