Add test case for "subproject:opt" in project()

This is regression test for #7573
pull/5071/merge
Xavier Claessens 4 years ago committed by Xavier Claessens
parent 7902d2032d
commit 254b836bd4
  1. 3
      test cases/common/90 default options/meson.build
  2. 3
      test cases/common/90 default options/subprojects/sub1/meson.build
  3. 1
      test cases/common/90 default options/subprojects/sub1/meson_options.txt

@ -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')

@ -0,0 +1,3 @@
project('sub1')
assert(get_option('test_option') == false)

@ -0,0 +1 @@
option('test_option', type : 'boolean', value : true, description : 'Test option. Superproject overrides default to "false"')
Loading…
Cancel
Save