Re: [Telepathy] testing telepathy-glib gi bindings

2016-07-03 Thread Diane Trout

> > import gi
> > gi.extend_path('/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?

Not yet. (at least not for real) I got distracted by trying to see if I
could get some support for Ad Hoc commands. (I hear you can use ad-hoc
commands to help manage your jabber server.)

As for telepathy-glib I need to figure out how insert the gi.repository
test into the current automake based makefiles and run it in a clean
chroot before I have any idea if it worked or not.

For ad-hoc commands my current implementation is to just code all the
command parsing code in telepathy-gabble-xmpp-console so I can figure
out how it should work. I think in the long term it might be reasonable
to ad a few more functions to the console plugin to support querying
ad-hoc commands (and maybe help parse XEP-0004 data forms)

Diane
___
telepathy mailing list
telepathy@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy


Re: [Telepathy] testing telepathy-glib gi bindings

2016-07-01 Thread George Kiagiadakis

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 .py

and start the test with:

import gi
gi.extend_path('/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'!

___
telepathy mailing list
telepathy@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy