Debian Codegraph @

test cases/unit/63 cmake parser/meson.build

raw
1 project('61 cmake parser')
2
3 dep = dependency('mesontest')
4
5 # Test a bunch of variations of the set() command
6 assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES') == 'NoSpaces', 'set() without spaces incorrect')
7 assert(dep.get_variable(cmake : 'VAR_WITH_SPACES') == 'With Spaces', 'set() with spaces incorrect')
8
9 assert(dep.get_variable(cmake : 'VAR_WITHOUT_SPACES_PS') == 'NoSpaces', 'set(PARENT_SCOPE) without spaces incorrect')
10 assert(dep.get_variable(cmake : 'VAR_WITH_SPACES_PS') == 'With Spaces', 'set(PARENT_SCOPE) with spaces incorrect')
11
12 assert(dep.get_variable(cmake : 'VAR_THAT_IS_UNSET', default_value : 'sentinel') == 'sentinel', 'set() to unset is incorrect')
13 assert(dep.get_variable(cmake : 'CACHED_STRING_NS') == 'foo', 'set(CACHED) without spaces is incorrect')
14 assert(dep.get_variable(cmake : 'CACHED_STRING_WS') == 'foo bar', 'set(CACHED STRING) with spaces is incorrect')
15 assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_NS') == 'foo;bar', 'set(CACHED STRING) without spaces is incorrect')
16 assert(dep.get_variable(cmake : 'CACHED_STRING_ARRAY_WS') == 'foo;foo bar;bar', 'set(CACHED STRING[]) with spaces is incorrect')
17
18 # We don't support this, so it should be unset.
19 assert(dep.get_variable(cmake : 'ENV{var}', default_value : 'sentinel') == 'sentinel', 'set(ENV) should be ignored')