Review Request 112681: Tests for KPluginTrader and friends

David Faure faure at kde.org
Sun Sep 15 08:42:31 UTC 2013


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


Data-driven tests *can* be run separately (and therefore qDebugs don't get confusing), using the "methodName:rowName" syntax as command-line argument.

Data-driven tests have the huge benefit that they reduce code duplication, and they make it a lot easier to add new tests (which means people tend to do it a lot more than with procedural tests).

I don't see which test "looks for a magic string in the plugin", in this change request all methods except the last one could easily be factorized, they perform the exact same steps with different data (and different expected result).

If this was Qt I'm pretty sure you'd be required to convert it to data-driven. But this is KDE, so I'll let you decide (now that you have all the data...).


- David Faure


On Sept. 14, 2013, 7:35 p.m., Sebastian Kügler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112681/
> -----------------------------------------------------------
> 
> (Updated Sept. 14, 2013, 7:35 p.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/20130915/951128d1/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list