I'm very new to QT, although I did a lot of C++ many years ago.
I've got a project set up, and a couple files. I'm using QTCreator and QT 4.5 (although I don't think this question is particularly version-specific).
I decided I wanted to try and write some tests.
What isn't clear to me, after reading the manual and the first couple pages of the tutorial is: What's the best practice for locating unit tests, what project do they go into, etc?
It looks like the manual assumes you're building a completely separate project for unit testing?
Is there a way to run tests if you build them into your main project?The syntax to execute an autotest takes the following simple form:
testname [options] [testfunctions[:testdata]]...
Substitute testname with the name of your executable. testfunctions can contain names of test functions to be executed. If no testfunctions are passed, all tests are run. If you append the name of an entry in testdata, the test function will be run only with that test data.
Is there an easy way to build a separate test project against the compiled output of your main project, rather than re-including all the same source files? (I've gotten spoiled by my dual-quad-core-cpu box at work, the old G4 I'm using at home has compile times measured in minutes...)
And this may be a more general project layout question, but if I want to have my classes separated into logical groups, it seems like the way to do that is with subdirectories with .PRI files in them, and one main project including all the PRIs. Any advice how to group tests with the code in the file system and/or in projects?
Thanks,
Jeff
Bookmarks