add python test for glib and test against lib
print->print_message is caused because GI does print->print_ in python bindings which is not good. Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
parent
7b0dd7299c
commit
0384fa9175
|
@ -17,6 +17,14 @@ enum {
|
|||
|
||||
static GParamSpec *gParamSpecs [LAST_PROP];
|
||||
|
||||
/**
|
||||
* meson_sample_new:
|
||||
* @msg: The message to set.
|
||||
*
|
||||
* Allocates a new #MesonSample.
|
||||
*
|
||||
* Returns: (transfer full): a #MesonSample.
|
||||
*/
|
||||
MesonSample *
|
||||
meson_sample_new (const gchar *msg)
|
||||
{
|
||||
|
@ -99,8 +107,16 @@ meson_sample_init (MesonSample *self)
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* meson_sample_print_message:
|
||||
* @self: a #MesonSample.
|
||||
*
|
||||
* Prints the message.
|
||||
*
|
||||
* Returns: Nothing.
|
||||
*/
|
||||
void
|
||||
meson_sample_print (MesonSample *self)
|
||||
meson_sample_print_message (MesonSample *self)
|
||||
{
|
||||
g_return_if_fail (MESON_IS_SAMPLE (self));
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (MesonSample, meson_sample, MESON, SAMPLE, GObject)
|
||||
|
||||
MesonSample *meson_sample_new (const gchar *msg);
|
||||
void meson_sample_print (MesonSample *self);
|
||||
MesonSample *meson_sample_new (const gchar *msg);
|
||||
void meson_sample_print_message (MesonSample *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
libsources = ['meson-sample.c', 'meson-sample.h']
|
||||
|
||||
girlib = shared_library(
|
||||
'girlib',
|
||||
sources : libsources,
|
||||
dependencies : gobj,
|
||||
install : true
|
||||
)
|
||||
|
||||
girexe = executable(
|
||||
'girprog',
|
||||
sources : [libsources, 'prog.c'],
|
||||
dependencies : [glib, gobj, gir]
|
||||
sources : 'prog.c',
|
||||
dependencies : [glib, gobj, gir],
|
||||
link_with : girlib
|
||||
)
|
||||
|
||||
gnome.generate_gir(
|
||||
girexe,
|
||||
girlib,
|
||||
sources : libsources,
|
||||
nsversion : '1.0',
|
||||
namespace : 'Meson',
|
||||
|
@ -17,4 +25,8 @@ gnome.generate_gir(
|
|||
install : true
|
||||
)
|
||||
|
||||
test('gobject introspection', girexe)
|
||||
test('gobject introspection/c', girexe)
|
||||
test('gobject introspection/py', find_program('prog.py'),
|
||||
env : ['GI_TYPELIB_PATH=@0@'.format(meson.current_build_dir()),
|
||||
'LD_LIBRARY_PATH=@0@'.format(meson.current_build_dir()),
|
||||
])
|
||||
|
|
|
@ -16,8 +16,8 @@ main (gint argc,
|
|||
return 1;
|
||||
}
|
||||
|
||||
g_autoptr(MesonSample) i = meson_sample_new ("Hello, meson!");
|
||||
meson_sample_print (i);
|
||||
g_autoptr(MesonSample) i = meson_sample_new ("Hello, meson/c!");
|
||||
meson_sample_print_message (i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
from gi.repository import Meson
|
||||
|
||||
if __name__ == "__main__":
|
||||
s = Meson.Sample.new("Hello, meson/py!")
|
||||
s.print_message()
|
|
@ -1,3 +1,4 @@
|
|||
usr/lib/girepository-1.0/Meson-1.0.typelib
|
||||
usr/lib/libgirlib.so
|
||||
usr/share/gir-1.0/Meson-1.0.gir
|
||||
usr/share/glib-2.0/schemas/com.github.meson.gschema.xml
|
||||
|
|
Loading…
Reference in New Issue