[Telepathy] testing telepathy-glib gi bindings

George Kiagiadakis gkiagia at tolabaki.gr
Sat Jul 2 05:52:10 UTC 2016


On 01.07.2016 08:49, Diane Trout wrote:
> Hi,
> 
> A long time ago I had briefly tried to use telepathy-glib from python
> and gave up because it kept segfaulting.
> 
> I've been wondering how hard it would be to add tests to telepathy-glib
> to verify that the gobject introspection bindings are working
> correctly. (And give examples of how to use the binding, in case my
> problems was me not calling things correctly).
> 
> My fist stab at trying to get this to work was to launch python with
> 
>  ./libtool --mode=execute python3 <test file>.py
> 
> and start the test with:
> 
> import gi
> gi.extend_path('<path to src>/telepathy-glib/telepathy-glib/',
> 'TelepathyGLib-0.12')
> gi.require_version('TelepathyGLib', '0.12')
> 
> To try and grab the recently built typelib instead of any one
> potentially already installed.

Did you try it? Did it work?

> Does anyone know of a project that includes test for their bindings?

PyGObject itself may give you some insights on how to do this. I suspect 
that a better approach would be to just run the .py file (without 
libtool and without the extra code to find the local typelib) and use 
environment variables to point it to the local typelib and libraries.

PyGObject uses these: 
https://git.gnome.org/browse/pygobject/tree/tests/Makefile.am#n139

Possibly GI_TYPELIB_PATH and LD_LIBRARY_PATH can do the trick.

> Does adding tests seem like a useful thing to do?

'tests' is synonymous to 'useful'!



More information about the telepathy mailing list