From 246d9f4564bb33e4404cc438932c206378b4b277 Mon Sep 17 00:00:00 2001 From: Nicolas Schneider Date: Sun, 13 Mar 2016 14:49:08 +0100 Subject: [PATCH] test24: check that a target extra_arg is not applied to other targets --- test cases/common/24 target arg/func2.c | 9 +++++++++ test cases/common/24 target arg/meson.build | 2 ++ test cases/common/24 target arg/prog2.cc | 13 +++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 test cases/common/24 target arg/func2.c create mode 100644 test cases/common/24 target arg/prog2.cc diff --git a/test cases/common/24 target arg/func2.c b/test cases/common/24 target arg/func2.c new file mode 100644 index 000000000..d3e91a56c --- /dev/null +++ b/test cases/common/24 target arg/func2.c @@ -0,0 +1,9 @@ +#ifdef CTHING +#error "Local C argument set in wrong target" +#endif + +#ifdef CPPTHING +#error "Local CPP argument set in wrong target" +#endif + +int func() { return 0; } diff --git a/test cases/common/24 target arg/meson.build b/test cases/common/24 target arg/meson.build index 5aec31d8b..11ac006c3 100644 --- a/test cases/common/24 target arg/meson.build +++ b/test cases/common/24 target arg/meson.build @@ -3,5 +3,7 @@ project('local arg test', 'cpp', 'c') exe1 = executable('prog', 'prog.cc', 'func.c', \ c_args : '-DCTHING', \ cpp_args : '-DCPPTHING') +exe2 = executable('prog2', 'prog2.cc', 'func2.c') test('prog1', exe1) +test('prog2', exe2) diff --git a/test cases/common/24 target arg/prog2.cc b/test cases/common/24 target arg/prog2.cc new file mode 100644 index 000000000..ef2fc4b37 --- /dev/null +++ b/test cases/common/24 target arg/prog2.cc @@ -0,0 +1,13 @@ +#ifdef CTHING +#error "Local C argument set in wrong target" +#endif + +#ifdef CPPTHING +#error "Local CPP argument set in wrong target" +#endif + +extern "C" int func(); + +int main(int argc, char **argv) { + return func(); +}