parent
c2e6565029
commit
6c963726cf
5 changed files with 23 additions and 7 deletions
@ -1,29 +1,25 @@ |
||||
project('args flattening') |
||||
|
||||
arr = get_variable('does-not-exist', ['bar', 'baz']) |
||||
|
||||
assert(arr == ['bar', 'baz'], 'get_variable with array fallback is broken') |
||||
|
||||
set_variable('arr', ['bar', 'baz']) |
||||
|
||||
assert(arr == ['bar', 'baz'], 'set_variable(array) is broken') |
||||
|
||||
conf = configuration_data() |
||||
|
||||
conf.set('foo', ['bar', 'baz']) |
||||
|
||||
assert(conf.get('foo') == ['bar', 'baz'], 'configuration_data.set(array) is broken') |
||||
|
||||
arr = conf.get('does-not-exist', ['bar', 'baz']) |
||||
|
||||
assert(arr == ['bar', 'baz'], 'configuration_data.get with array fallback is broken') |
||||
|
||||
arr = meson.get_cross_property('does-not-exist', ['bar', 'baz']) |
||||
|
||||
assert(arr == ['bar', 'baz'], 'meson.get_cross_property with array fallback is broken') |
||||
|
||||
arr = meson.get_native_property('does-not-exist', ['bar', 'baz']) |
||||
assert(arr == ['bar', 'baz'], 'meson.get_native_property with array fallback is broken') |
||||
|
||||
# Test deprecated behaviour |
||||
|
||||
conf.set(['foo', 'bar']) |
||||
|
||||
message(conf.get('foo')) |
||||
|
@ -0,0 +1,10 @@ |
||||
project('get native prop') |
||||
|
||||
x = meson.get_native_property('astring') |
||||
assert(x=='mystring', 'did not get native property string. did you use "meson setup --native-file native.txt"') |
||||
|
||||
x = meson.get_native_property('notexist', 'fallback') |
||||
assert(x=='fallback', 'fallback did not work') |
||||
|
||||
x = meson.get_native_property('anarray') |
||||
assert(x==['one', 'two'], 'array did not work') |
@ -0,0 +1,3 @@ |
||||
[properties] |
||||
astring = 'mystring' |
||||
anarray = ['one', 'two'] |
@ -0,0 +1,3 @@ |
||||
project('missing native property') |
||||
|
||||
message(meson.get_native_property('nonexisting')) |
Loading…
Reference in new issue