It can be either: - boolean: the option is completely deprecated. - list: some choices are deprecated. - dict: some choices are deprecated and replaced by another. Fixes: #7444pull/9382/head
parent
953bbf5e19
commit
77ef437cc4
6 changed files with 117 additions and 2 deletions
@ -0,0 +1,15 @@ |
|||||||
|
project('deprecated options', |
||||||
|
default_options: [ |
||||||
|
'o1=false', |
||||||
|
'o2=a,b', |
||||||
|
'o3=a,b', |
||||||
|
'o4=true', |
||||||
|
'o5=auto', |
||||||
|
] |
||||||
|
) |
||||||
|
|
||||||
|
assert(get_option('o1') == false) |
||||||
|
assert(get_option('o2') == ['a', 'b']) |
||||||
|
assert(get_option('o3') == ['c', 'b']) |
||||||
|
assert(get_option('o4').enabled()) |
||||||
|
assert(get_option('o5') == false) |
@ -0,0 +1,15 @@ |
|||||||
|
# Option fully deprecated, it warns when any value is set. |
||||||
|
option('o1', type: 'boolean', deprecated: true) |
||||||
|
|
||||||
|
# One of the choices is deprecated, it warns only when 'a' is in the list of values. |
||||||
|
option('o2', type: 'array', choices: ['a', 'b'], deprecated: ['a']) |
||||||
|
|
||||||
|
# One of the choices is deprecated, it warns only when 'a' is in the list of values |
||||||
|
# and replace it by 'c'. |
||||||
|
option('o3', type: 'array', choices: ['a', 'b', 'c'], deprecated: {'a': 'c'}) |
||||||
|
|
||||||
|
# A boolean option has been replaced by a feature, old true/false values are remapped. |
||||||
|
option('o4', type: 'feature', deprecated: {'true': 'enabled', 'false': 'disabled'}) |
||||||
|
|
||||||
|
# A feature option has been replaced by a boolean, enabled/disabled/auto values are remapped. |
||||||
|
option('o5', type: 'boolean', deprecated: {'enabled': 'true', 'disabled': 'false', 'auto': 'false'}) |
@ -0,0 +1,29 @@ |
|||||||
|
{ |
||||||
|
"stdout": [ |
||||||
|
{ |
||||||
|
"line": ".*DEPRECATION: Option 'o1' is deprecated", |
||||||
|
"match": "re", |
||||||
|
"count": 1 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"line": ".*DEPRECATION: Option 'o2' value 'a' is deprecated", |
||||||
|
"match": "re", |
||||||
|
"count": 1 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"line": ".*DEPRECATION: Option 'o3' value 'a' is replaced by 'c'", |
||||||
|
"match": "re", |
||||||
|
"count": 1 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"line": ".*DEPRECATION: Option 'o4' value 'true' is replaced by 'enabled'", |
||||||
|
"match": "re", |
||||||
|
"count": 1 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"line": ".*DEPRECATION: Option 'o5' value 'auto' is replaced by 'false'", |
||||||
|
"match": "re", |
||||||
|
"count": 1 |
||||||
|
} |
||||||
|
] |
||||||
|
} |
Loading…
Reference in new issue