PDA

View Full Version : GUI runner of QTestLib



Intaek Lim
25th April 2007, 03:22
I just wrote qui test runner of QTestLib. Althouth I tried to make it run somewhat similiar to JUnit, it's not interactive as JUnit because there's no way to capture(hook) call of test functions.

So, I saved test results in xml format and read them after all tests are executed(This is why my runner is not interactive). Are there any alternatives for this?

You guys can download the source code and see screenshots here:

http://janbyul.com/moin/moin.cgi/Qt4/UnitTestByMyself


Thanks,
Intaek.

camel
25th April 2007, 09:06
What you could do is use QXmlStreamReader (http://doc.trolltech.com/4.3/qxmlstreamreader.html) from the not yet released 4.3. It allows you to read XML data in a stream based way, meaning you can start to parse the data before the document is finished, i.e. updating on the fly. (See Incremental parsing)

On a different note:
I am not sure if your approach to run the tests in process is the ideal solution - tests can crash, and sometimes tests need application objects themselves. I am not sure that having two QApplication objects in an app works. Why don't you try launching the test using QProcess and processing the output of it using QXmlStreamReader?