Testing Qt plugins
-
Hello,
What's best way to test Qt plugins which used for building Qt Application Plugin based?
Usually I make my tests through the main GUI interface application but I wonder is there any way to run or test this kind of plugins from test interface instead of the main GUI interface?
-
Hi,
What I do is to write a test suite using QTest within the plugin project to test everything.
If things rely on a user interaction, I usually write a little test application for the functionality
Hope it helps
-
bq. What I do is to write a test suite using QTest within the plugin project to test everything.
I never used QTest before so I've to read about it now.
Btw, Do you've any example or tutorial about how to use it in nutshell?
-
It's really as simple as what the documentation shows.
What I generally do is create a subfolder tests where all test resides. IIRC you can even create the test projects directly from QtCreator -
A good start for me was creating a test project with creator.
Create a new project in creator. Under "Other Porjects" there is "Qt Unit Test". The creation allows you to make a couple of choices. IMHO it is quite easy to start.
There is a "testlib overview":http://qt-project.org/doc/qt-5.0/qttestlib/qtest-overview.html and "there is QTest tutorial":http://qt-project.org/doc/qt-5.0/qttestlib/qtest-tutorial.html