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.
pull/1194/head
Nirbheek Chauhan 8 years ago
parent e6f48a03fc
commit de0ce7f25c
  1. 13
      test cases/vala/15 static vapi in source tree/meson.build
  2. 6
      test cases/vala/15 static vapi in source tree/test.vala
  3. 4
      test cases/vala/15 static vapi in source tree/vapi/config.vapi

@ -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)

@ -0,0 +1,6 @@
using GLib;
using Config;
public int main (string[] args) {
return GLib.strcmp(VERSION, "1.0.0");
}

@ -0,0 +1,4 @@
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Config {
public const string VERSION;
}
Loading…
Cancel
Save