Review Request 112681: Tests for KPluginTrader and friends

Sebastian Kügler sebas at kde.org
Sat Sep 14 19:33:59 UTC 2013



> On Sept. 13, 2013, 8:39 a.m., David Faure wrote:
> > staging/kservice/tests/pluginlocator/CMakeLists.txt, line 12
> > <http://git.reviewboard.kde.org/r/112681/diff/1/?file=189065#file189065line12>
> >
> >     Add a comment (on the same line) about why it's needed

It's not actually needed, removed it.


> On Sept. 13, 2013, 8:39 a.m., David Faure wrote:
> > staging/kservice/autotests/pluginlocatortest.cpp, line 79
> > <http://git.reviewboard.kde.org/r/112681/diff/1/?file=189063#file189063line79>
> >
> >     this should be data-driven.
> >     
> >     The code is almost the same in all these findPlugin*() tests, only the input data (e.g. the constraint) and the expected result (0 or 1) changes -> create a _data() method with 3 columns (servicetype, constraint, expectedResultCount)

I tend to stick qDebug() statements into specific tests, adding an indirection there could make this a little less straightforward. It would also really make sense for some of the tests, there's quite a bunch where we want to just find something, or have more interesting conditions (like the one testing for a magic string in the plugin). Small bonus is that all the tests stay self-contained, so they're easy to reuse elsewhere.

I'll drop this one.


- Sebastian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112681/#review39943
-----------------------------------------------------------


On Sept. 12, 2013, 3:35 a.m., Sebastian Kügler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112681/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2013, 3:35 a.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Description
> -------
> 
> Tests for KPluginTrader.
> 
> Under autotests/, there's a new test class which runs a variety of queries using KPluginTrader. There's also a small plugin, which is used to verify correct metadata querying and loading. It's not installed since QPluginLoader conveniently contains the working directory when looking for plugins -> it's found just fine.
> 
> Under tests/, there's a test which will query for a variety of other plugins. This one is more geared towards performance testing. When run from make test, it will pass anyway.
> 
> Code can also be found in kdelibs[sebas/pluginlocator].
> 
> 
> Diffs
> -----
> 
>   staging/kservice/autotests/CMakeLists.txt d341040 
>   staging/kservice/autotests/fakeplugin.desktop PRE-CREATION 
>   staging/kservice/autotests/fakeplugin.json PRE-CREATION 
>   staging/kservice/autotests/nsaplugin.h PRE-CREATION 
>   staging/kservice/autotests/nsaplugin.cpp PRE-CREATION 
>   staging/kservice/autotests/pluginlocatortest.h PRE-CREATION 
>   staging/kservice/autotests/pluginlocatortest.cpp PRE-CREATION 
>   staging/kservice/tests/CMakeLists.txt 3793aea 
>   staging/kservice/tests/pluginlocator/CMakeLists.txt PRE-CREATION 
>   staging/kservice/tests/pluginlocator/main.cpp PRE-CREATION 
>   staging/kservice/tests/pluginlocator/plugintest.h PRE-CREATION 
>   staging/kservice/tests/pluginlocator/plugintest.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/112681/diff/
> 
> 
> Testing
> -------
> 
> make test =)
> 
> All tests pass on top of my patches.
> 
> 
> Thanks,
> 
> Sebastian Kügler
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130914/b92dedac/attachment.html>


More information about the Kde-frameworks-devel mailing list