diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-08 01:09:48 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-10-14 19:13:21 +0530 |
commit | 354c4bcaeb093e1b8ef161985901b23957314bc0 (patch) | |
tree | 404fc3c0fa0fb0684ebe7227c378d6f16b5ab683 /test cases/failing build | |
parent | b08c8c7b7710cf1ed5597f9ea87bc3e911b2c5dc (diff) | |
download | meson-354c4bcaeb093e1b8ef161985901b23957314bc0.zip meson-354c4bcaeb093e1b8ef161985901b23957314bc0.tar.gz meson-354c4bcaeb093e1b8ef161985901b23957314bc0.tar.bz2 |
Test that warnings apply to C files in Vala targets
Diffstat (limited to 'test cases/failing build')
-rw-r--r-- | test cases/failing build/1 vala c werror/meson.build | 10 | ||||
-rw-r--r-- | test cases/failing build/1 vala c werror/prog.vala | 7 | ||||
-rw-r--r-- | test cases/failing build/1 vala c werror/unused-var.c | 6 |
3 files changed, 23 insertions, 0 deletions
diff --git a/test cases/failing build/1 vala c werror/meson.build b/test cases/failing build/1 vala c werror/meson.build new file mode 100644 index 0000000..736d7aa --- /dev/null +++ b/test cases/failing build/1 vala c werror/meson.build @@ -0,0 +1,10 @@ +project('valatest', 'c', default_options : 'werror=true') + +if find_program('valac', required : false).found() + add_languages('vala') + valadeps = [dependency('glib-2.0'), dependency('gobject-2.0')] + # Must fail due to -Werror and unused variable in C file + executable('valaprog', 'prog.vala', 'unused-var.c', dependencies : valadeps) +else + executable('failprog', 'unused-var.c') +endif diff --git a/test cases/failing build/1 vala c werror/prog.vala b/test cases/failing build/1 vala c werror/prog.vala new file mode 100644 index 0000000..638e776 --- /dev/null +++ b/test cases/failing build/1 vala c werror/prog.vala @@ -0,0 +1,7 @@ +class MainProg : GLib.Object { + + public static int main(string[] args) { + stdout.printf("Vala is working.\n"); + return 0; + } +} diff --git a/test cases/failing build/1 vala c werror/unused-var.c b/test cases/failing build/1 vala c werror/unused-var.c new file mode 100644 index 0000000..e11d64c --- /dev/null +++ b/test cases/failing build/1 vala c werror/unused-var.c @@ -0,0 +1,6 @@ +int +somelib(void) +{ + int unused_var; + return 33; +} |