diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-14 22:25:52 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-15 04:12:23 +0530 |
commit | de0ce7f25c1bc1038fdca66237281722eca64494 (patch) | |
tree | 7f19f5578334a9db914c6da0105af61e8a588e81 | |
parent | e6f48a03fc989119bb56ea5c7b748f99f0404b5b (diff) | |
download | meson-de0ce7f25c1bc1038fdca66237281722eca64494.zip meson-de0ce7f25c1bc1038fdca66237281722eca64494.tar.gz meson-de0ce7f25c1bc1038fdca66237281722eca64494.tar.bz2 |
Add a test that uses hand-written vapi files
To use these, you just need to add the .vapi file to your target as
a source.
This test specifically tests that hand-written vapis referring to
C headers work.
3 files changed, 23 insertions, 0 deletions
diff --git a/test cases/vala/15 static vapi in source tree/meson.build b/test cases/vala/15 static vapi in source tree/meson.build new file mode 100644 index 0000000..44bea48 --- /dev/null +++ b/test cases/vala/15 static vapi in source tree/meson.build @@ -0,0 +1,13 @@ +project('static vapi', 'c', 'vala') + +glib = dependency('glib-2.0') + +conf = configuration_data() +conf.set_quoted('VERSION', '1.0.0') +config_h = configure_file(output : 'config.h', + configuration : conf) + +e = executable('static-vapi', 'vapi/config.vapi', 'test.vala', + dependencies : glib) + +test('test-config', e) diff --git a/test cases/vala/15 static vapi in source tree/test.vala b/test cases/vala/15 static vapi in source tree/test.vala new file mode 100644 index 0000000..06f2d59 --- /dev/null +++ b/test cases/vala/15 static vapi in source tree/test.vala @@ -0,0 +1,6 @@ +using GLib; +using Config; + +public int main (string[] args) { + return GLib.strcmp(VERSION, "1.0.0"); +} diff --git a/test cases/vala/15 static vapi in source tree/vapi/config.vapi b/test cases/vala/15 static vapi in source tree/vapi/config.vapi new file mode 100644 index 0000000..71bcc6e --- /dev/null +++ b/test cases/vala/15 static vapi in source tree/vapi/config.vapi @@ -0,0 +1,4 @@ +[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")] +namespace Config { + public const string VERSION; +} |