diff options
Diffstat (limited to 'test cases/vala/11 generated vapi')
-rw-r--r-- | test cases/vala/11 generated vapi/libbar/bar.c | 29 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/libbar/bar.h | 9 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/libbar/meson.build | 32 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/libfoo/foo.c | 28 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/libfoo/foo.h | 9 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/libfoo/foo.metadata | 1 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/libfoo/meson.build | 42 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/main.vala | 9 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/meson.build | 13 | ||||
-rw-r--r-- | test cases/vala/11 generated vapi/test.json | 13 |
10 files changed, 185 insertions, 0 deletions
diff --git a/test cases/vala/11 generated vapi/libbar/bar.c b/test cases/vala/11 generated vapi/libbar/bar.c new file mode 100644 index 0000000..3037141 --- /dev/null +++ b/test cases/vala/11 generated vapi/libbar/bar.c @@ -0,0 +1,29 @@ +#include "bar.h" +#include "foo.h" + +struct _BarBar +{ + GObject parent_instance; +}; + +G_DEFINE_TYPE (BarBar, bar_bar, G_TYPE_OBJECT) + +static void +bar_bar_class_init (BarBarClass *klass) +{ +} + +static void +bar_bar_init (BarBar *self) +{ +} + +/** + * bar_bar_return_success: + * + * Returns 0 + */ +int bar_bar_return_success(void) +{ + return foo_foo_return_success(); +} diff --git a/test cases/vala/11 generated vapi/libbar/bar.h b/test cases/vala/11 generated vapi/libbar/bar.h new file mode 100644 index 0000000..4ca7270 --- /dev/null +++ b/test cases/vala/11 generated vapi/libbar/bar.h @@ -0,0 +1,9 @@ +#include <glib-object.h> + +#pragma once + +#define BAR_TYPE_BAR (bar_bar_get_type()) + +G_DECLARE_FINAL_TYPE (BarBar, bar_bar, BAR, BAR, GObject) + +int bar_bar_return_success(void); diff --git a/test cases/vala/11 generated vapi/libbar/meson.build b/test cases/vala/11 generated vapi/libbar/meson.build new file mode 100644 index 0000000..0bf7d5c --- /dev/null +++ b/test cases/vala/11 generated vapi/libbar/meson.build @@ -0,0 +1,32 @@ +libbar_sources = [ + 'bar.c', + 'bar.h', +] + +libbar_deps = [ + dependency('gobject-2.0'), + libfoo_dep, +] + +libbar = shared_library('bar', libbar_sources, + dependencies: libbar_deps, + install: true, +) + +libbar_api_ver = '1.0' + +libbar_gir = gnome.generate_gir(libbar, + sources: libbar_sources, + namespace: 'Bar', + nsversion: libbar_api_ver, + symbol_prefix: 'bar', + extra_args: [ + '--c-include=bar.h', + ], +) + +libbar_vapi = gnome.generate_vapi('bar-' + libbar_api_ver, + sources: libbar_gir[0], + packages: libfoo_vapi, + install: true, +) diff --git a/test cases/vala/11 generated vapi/libfoo/foo.c b/test cases/vala/11 generated vapi/libfoo/foo.c new file mode 100644 index 0000000..dd2b891 --- /dev/null +++ b/test cases/vala/11 generated vapi/libfoo/foo.c @@ -0,0 +1,28 @@ +#include "foo.h" + +struct _FooFoo +{ + GObject parent_instance; +}; + +G_DEFINE_TYPE (FooFoo, foo_foo, G_TYPE_OBJECT) + +static void +foo_foo_class_init (FooFooClass *klass) +{ +} + +static void +foo_foo_init (FooFoo *self) +{ +} + +/** + * foo_foo_return_success: + * + * Returns 0 + */ +int foo_foo_return_success(void) +{ + return 0; +} diff --git a/test cases/vala/11 generated vapi/libfoo/foo.h b/test cases/vala/11 generated vapi/libfoo/foo.h new file mode 100644 index 0000000..e1887d8 --- /dev/null +++ b/test cases/vala/11 generated vapi/libfoo/foo.h @@ -0,0 +1,9 @@ +#include <glib-object.h> + +#pragma once + +#define FOO_TYPE_FOO (foo_foo_get_type()) + +G_DECLARE_FINAL_TYPE (FooFoo, foo_foo, Foo, FOO, GObject) + +int foo_foo_return_success(void); diff --git a/test cases/vala/11 generated vapi/libfoo/foo.metadata b/test cases/vala/11 generated vapi/libfoo/foo.metadata new file mode 100644 index 0000000..e208fe3 --- /dev/null +++ b/test cases/vala/11 generated vapi/libfoo/foo.metadata @@ -0,0 +1 @@ +Foo.bar nullable diff --git a/test cases/vala/11 generated vapi/libfoo/meson.build b/test cases/vala/11 generated vapi/libfoo/meson.build new file mode 100644 index 0000000..ee425f2 --- /dev/null +++ b/test cases/vala/11 generated vapi/libfoo/meson.build @@ -0,0 +1,42 @@ +libfoo_sources = [ + 'foo.c', + 'foo.h', +] + +libfoo_deps = [ + dependency('gobject-2.0') +] + +libfoo = shared_library('foo', libfoo_sources, + dependencies: libfoo_deps, + install: true, +) + +libfoo_api_ver = '1.0' + +libfoo_gir = gnome.generate_gir(libfoo, + sources: libfoo_sources, + namespace: 'Foo', + nsversion: libfoo_api_ver, + symbol_prefix: 'foo', + extra_args: [ + '--c-include=foo.h', + ], +) + +configure_file( + input: 'foo.metadata', + output: 'Foo-@0@.metadata'.format(libfoo_api_ver), + copy: true +) + +libfoo_vapi = gnome.generate_vapi('foo-' + libfoo_api_ver, + metadata_dirs: meson.current_build_dir(), + sources: libfoo_gir[0], + install: true, +) + +libfoo_dep = declare_dependency( + link_with: libfoo, + include_directories: include_directories('.'), +) diff --git a/test cases/vala/11 generated vapi/main.vala b/test cases/vala/11 generated vapi/main.vala new file mode 100644 index 0000000..d61fba0 --- /dev/null +++ b/test cases/vala/11 generated vapi/main.vala @@ -0,0 +1,9 @@ +using Foo; +using Bar; + +class Main : GLib.Object { + public static int main(string[] args) { + var ignore = Foo.Foo.return_success(); + return Bar.Bar.return_success(); + } +} diff --git a/test cases/vala/11 generated vapi/meson.build b/test cases/vala/11 generated vapi/meson.build new file mode 100644 index 0000000..d5f38ca --- /dev/null +++ b/test cases/vala/11 generated vapi/meson.build @@ -0,0 +1,13 @@ +project('vapi-test', ['c', 'vala']) + +gnome = import('gnome') +subdir('libfoo') +subdir('libbar') + +vapiexe = executable('vapigen-test', + 'main.vala', + dependencies: [dependency('gobject-2.0'), libfoo_vapi, libbar_vapi], + install: true, +) + +test('vapigen-test', vapiexe) diff --git a/test cases/vala/11 generated vapi/test.json b/test cases/vala/11 generated vapi/test.json new file mode 100644 index 0000000..1a742aa --- /dev/null +++ b/test cases/vala/11 generated vapi/test.json @@ -0,0 +1,13 @@ +{ + "installed": [ + {"type": "exe", "file": "usr/bin/vapigen-test"}, + {"type": "expr", "file": "usr/lib/?libfoo.so"}, + {"type": "file", "platform": "cygwin", "file": "usr/lib/libfoo.dll.a"}, + {"type": "expr", "file": "usr/lib/?libbar.so"}, + {"type": "file", "platform": "cygwin", "file": "usr/lib/libbar.dll.a"}, + {"type": "file", "file": "usr/share/vala/vapi/foo-1.0.vapi"}, + {"type": "file", "file": "usr/share/vala/vapi/foo-1.0.deps"}, + {"type": "file", "file": "usr/share/vala/vapi/bar-1.0.vapi"}, + {"type": "file", "file": "usr/share/vala/vapi/bar-1.0.deps"} + ] +} |