summaryrefslogtreecommitdiffstats
path: root/test cases/vala/4 config
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/vala/4 config
parentInitial commit. (diff)
downloadmeson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz
meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/vala/4 config')
-rw-r--r--test cases/vala/4 config/config.vapi1
-rw-r--r--test cases/vala/4 config/meson-something-else.vapi1
-rw-r--r--test cases/vala/4 config/meson.build15
-rw-r--r--test cases/vala/4 config/prog.vala8
4 files changed, 25 insertions, 0 deletions
diff --git a/test cases/vala/4 config/config.vapi b/test cases/vala/4 config/config.vapi
new file mode 100644
index 0000000..6845417
--- /dev/null
+++ b/test cases/vala/4 config/config.vapi
@@ -0,0 +1 @@
+public const string DATA_DIRECTORY;
diff --git a/test cases/vala/4 config/meson-something-else.vapi b/test cases/vala/4 config/meson-something-else.vapi
new file mode 100644
index 0000000..ce2b83a
--- /dev/null
+++ b/test cases/vala/4 config/meson-something-else.vapi
@@ -0,0 +1 @@
+public const string SOMETHING_ELSE;
diff --git a/test cases/vala/4 config/meson.build b/test cases/vala/4 config/meson.build
new file mode 100644
index 0000000..7cb93cf
--- /dev/null
+++ b/test cases/vala/4 config/meson.build
@@ -0,0 +1,15 @@
+project('valatest', 'vala', 'c')
+
+valac = meson.get_compiler('vala')
+# Try to find our library
+valadeps = [valac.find_library('meson-something-else', dirs : meson.current_source_dir())]
+valadeps += [dependency('glib-2.0'), dependency('gobject-2.0')]
+
+e = executable(
+'valaprog',
+sources : ['config.vapi', 'prog.vala'],
+dependencies : valadeps,
+c_args : ['-DDATA_DIRECTORY="@0@"'.format(meson.current_source_dir()),
+ '-DSOMETHING_ELSE="Out of this world!"']
+)
+test('valatest', e)
diff --git a/test cases/vala/4 config/prog.vala b/test cases/vala/4 config/prog.vala
new file mode 100644
index 0000000..2b08dad
--- /dev/null
+++ b/test cases/vala/4 config/prog.vala
@@ -0,0 +1,8 @@
+class MainProg : GLib.Object {
+
+ public static int main(string[] args) {
+ stdout.printf("DATA_DIRECTORY is: %s.\n", DATA_DIRECTORY);
+ stdout.printf("SOMETHING_ELSE is: %s.\n", SOMETHING_ELSE);
+ return 0;
+ }
+}