summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-11 13:13:04 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-14 19:13:38 +0530
commit9ac98040ae06ec4c0da059a3cd8c729626d6099c (patch)
tree64a36827e35da2b413f7c63139ccd3ada4626e43 /test cases
parent354c4bcaeb093e1b8ef161985901b23957314bc0 (diff)
downloadmeson-9ac98040ae06ec4c0da059a3cd8c729626d6099c.tar.gz
Add a unittest using the Vala and C warnings test
This actually tests that -Wall, -Werror, and -w are set in the right targets.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/vala/5 target glib/GLib.Thread.vala4
-rw-r--r--test cases/vala/5 target glib/meson.build2
-rw-r--r--test cases/vala/5 target glib/retcode.c5
3 files changed, 9 insertions, 2 deletions
diff --git a/test cases/vala/5 target glib/GLib.Thread.vala b/test cases/vala/5 target glib/GLib.Thread.vala
index 27c0fca17..a1a0414cd 100644
--- a/test cases/vala/5 target glib/GLib.Thread.vala
+++ b/test cases/vala/5 target glib/GLib.Thread.vala
@@ -1,3 +1,5 @@
+extern int get_ret_code ();
+
public class MyThread : Object {
public int x_times { get; private set; }
@@ -12,7 +14,7 @@ public class MyThread : Object {
}
// return & exit have the same effect
- Thread.exit (42);
+ Thread.exit (get_ret_code ());
return 43;
}
}
diff --git a/test cases/vala/5 target glib/meson.build b/test cases/vala/5 target glib/meson.build
index 679e9080f..3f0d01e7b 100644
--- a/test cases/vala/5 target glib/meson.build
+++ b/test cases/vala/5 target glib/meson.build
@@ -2,5 +2,5 @@ project('valatest', 'vala', 'c', default_options : ['werror=true'])
valadeps = [dependency('glib-2.0', version : '>=2.32'), dependency('gobject-2.0')]
-e = executable('valaprog', 'GLib.Thread.vala', dependencies : valadeps)
+e = executable('valaprog', 'GLib.Thread.vala', 'retcode.c', dependencies : valadeps)
test('valatest', e)
diff --git a/test cases/vala/5 target glib/retcode.c b/test cases/vala/5 target glib/retcode.c
new file mode 100644
index 000000000..abca9bfab
--- /dev/null
+++ b/test cases/vala/5 target glib/retcode.c
@@ -0,0 +1,5 @@
+int
+get_ret_code (void)
+{
+ return 42;
+}