PDA

View Full Version : Qt test application



kunalnandi
12th October 2007, 09:22
hello all,

first of all let me explain my problem,

wht traditionally do in a typical test application is that we just hard code that function name, its input and compare its output with the expected output using macro QCOMPARE.

i have to develop a test application in which, i have to take input from a text file containing function name, input and expected output sapareted by tab...

so can any body tell me how to do this using QtTest module.. or is there any other alternative... ???? if possible thn pls send me demo example...

Regards
Kunal Nandi

wysota
12th October 2007, 11:27
Take a look at data driven testing:
http://doc.trolltech.com/latest/qtestlib-tutorial2.html
You can generate test vectors from a file, provided that the methods you want to test are callable through QMetaObject::invokeMethod(). If they are not, I suggest you write a small application that will take your input files and generate C++ code that uses QTestLib to perform the tests. Then you can include and compile such code into the final testing executable.