From 254b836bd49a10dd2cb4a91771398a8d08d59dda Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 9 Aug 2020 07:57:51 -0400 Subject: [PATCH] Add test case for "subproject:opt" in project() This is regression test for #7573 --- test cases/common/90 default options/meson.build | 3 +++ .../common/90 default options/subprojects/sub1/meson.build | 3 +++ .../90 default options/subprojects/sub1/meson_options.txt | 1 + 3 files changed, 7 insertions(+) create mode 100644 test cases/common/90 default options/subprojects/sub1/meson.build create mode 100644 test cases/common/90 default options/subprojects/sub1/meson_options.txt diff --git a/test cases/common/90 default options/meson.build b/test cases/common/90 default options/meson.build index 4a9fc2fe7..51b5cdac9 100644 --- a/test cases/common/90 default options/meson.build +++ b/test cases/common/90 default options/meson.build @@ -4,6 +4,7 @@ project('default options', 'cpp', 'c', default_options : [ 'cpp_std=c++11', 'cpp_eh=none', 'warning_level=3', + 'sub1:test_option=false', ]) assert(get_option('buildtype') == 'debugoptimized', 'Build type default value wrong.') @@ -28,3 +29,5 @@ assert(w_level == '3', 'warning level "' + w_level + '" instead of "3"') # assert(not cc.compiles('int foobar;'), 'Default arg not used in test.') # assert(cc.compiles('int foobar;', no_builtin_args : true), 'No_builtin did not disable builtins.') # endif + +subproject('sub1') diff --git a/test cases/common/90 default options/subprojects/sub1/meson.build b/test cases/common/90 default options/subprojects/sub1/meson.build new file mode 100644 index 000000000..de0dc216c --- /dev/null +++ b/test cases/common/90 default options/subprojects/sub1/meson.build @@ -0,0 +1,3 @@ +project('sub1') + +assert(get_option('test_option') == false) diff --git a/test cases/common/90 default options/subprojects/sub1/meson_options.txt b/test cases/common/90 default options/subprojects/sub1/meson_options.txt new file mode 100644 index 000000000..fc96f5e09 --- /dev/null +++ b/test cases/common/90 default options/subprojects/sub1/meson_options.txt @@ -0,0 +1 @@ +option('test_option', type : 'boolean', value : true, description : 'Test option. Superproject overrides default to "false"')