diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-07-27 18:35:20 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-14 23:06:55 +0300 |
commit | 219dec39c09789f2b296e5af00305fe05fa3362b (patch) | |
tree | 530052f1009e5757dc3e6ad88f91255f96ce989b /test cases | |
parent | 28754ea621930a812f6c885d3c64cd90d95b4ce8 (diff) | |
download | meson-219dec39c09789f2b296e5af00305fe05fa3362b.zip meson-219dec39c09789f2b296e5af00305fe05fa3362b.tar.gz meson-219dec39c09789f2b296e5af00305fe05fa3362b.tar.bz2 |
Fix yielding when subproject option type is different
Earlier, we would replace the subproject option with the parent
project's option, which is incorrect if the types are not the same.
Now we retain the subproject's option and print a warning. It's not
advisable to issue an error in this case because subproject option
yielding is involuntary for the parent project (option names can match
because of coincidences).
Diffstat (limited to 'test cases')
4 files changed, 5 insertions, 1 deletions
diff --git a/test cases/common/175 yield/meson.build b/test cases/common/175 yield/meson.build index ba3e426..9b11569 100644 --- a/test cases/common/175 yield/meson.build +++ b/test cases/common/175 yield/meson.build @@ -3,4 +3,5 @@ project('yield_options', 'c') subproject('sub') assert(get_option('unshared_option') == 'one', 'Unshared option has wrong value in superproject.') -assert(get_option('shared_option') == 'two', 'Unshared option has wrong value in superproject..') +assert(get_option('shared_option') == 'two', 'Shared option has wrong value in superproject..') +assert(get_option('wrongtype_option') == 'three', 'Wrongtype option has wrong value in superproject..') diff --git a/test cases/common/175 yield/meson_options.txt b/test cases/common/175 yield/meson_options.txt index 36bad4b..9f58fbb 100644 --- a/test cases/common/175 yield/meson_options.txt +++ b/test cases/common/175 yield/meson_options.txt @@ -1,2 +1,3 @@ option('unshared_option', type : 'string', value : 'one') option('shared_option', type : 'string', value : 'two') +option('wrongtype_option', type : 'string', value : 'three') diff --git a/test cases/common/175 yield/subprojects/sub/meson.build b/test cases/common/175 yield/subprojects/sub/meson.build index 3a506e0..832c13c 100644 --- a/test cases/common/175 yield/subprojects/sub/meson.build +++ b/test cases/common/175 yield/subprojects/sub/meson.build @@ -2,3 +2,4 @@ project('subbie', 'c') assert(get_option('unshared_option') == 'three', 'Unshared option has wrong value in subproject.') assert(get_option('shared_option') == 'two', 'Shared option has wrong value in subproject.') +assert(get_option('wrongtype_option') == true, 'Wrongtype option has wrong value in subproject.') diff --git a/test cases/common/175 yield/subprojects/sub/meson_options.txt b/test cases/common/175 yield/subprojects/sub/meson_options.txt index a96c307..101122e 100644 --- a/test cases/common/175 yield/subprojects/sub/meson_options.txt +++ b/test cases/common/175 yield/subprojects/sub/meson_options.txt @@ -1,2 +1,3 @@ option('unshared_option', type : 'string', value : 'three', yield : false) option('shared_option', type : 'string', value : 'four', yield : true) +option('wrongtype_option', type : 'boolean', value : true, yield : true) |