Developing/testing add-ons
#1
Hi there

I'm after recommendations on how to efficiently develop an add-on for Kodi...

Is there any kind of emulator to quickly test? Or do you pretty much have to run a Kodi installation and run/test your code in that?

I plan to develop a service extension. What would be a good way to do that and frequently run/test code?

Cheers
Reply
#2
(2016-04-12, 10:31)jgivings Wrote: Hi there

I'm after recommendations on how to efficiently develop an add-on for Kodi...

Is there any kind of emulator to quickly test? Or do you pretty much have to run a Kodi installation and run/test your code in that?

Cheers

There is no actual Kodi emulator, though there have been some attempt to emulate at least some parts of Kodi Python API. And it's all depends on what you actually want to test. A good approach is to separate your addon into minimal function parts (units), with separate Kodi and non-Kodi parts. With such approach you can use unit testing to test at least for obvious bugs. As for interaction with Kodi Python API, you can use stubs or some mocking library to emulate Kodi API behavior.

For example, here are unit test for my SimplePlugin library that I use for my projects: https://github.com/romanvm/script.module...r/tests.py
The library is a wrapper around Kodi Addon/Plugin API, but unit tests use mock library to emulate interaction with Kodi, so that unit tests can be run outside Kodi (in Travis CI actually).
Reply

Logout Mark Read Team Forum Stats Members Help
Developing/testing add-ons0