Skip to content

Commit bcd50e7

Browse files
ePiratxclaesse
authored andcommitted
test: Add get_define test with prefix array
1 parent 85a58f1 commit bcd50e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test cases/common/132 get define/meson.build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ foreach lang : ['c', 'cpp']
6666
have = cc.get_define('MESON_FAIL_VALUE')
6767
assert(have == '', 'MESON_FAIL_VALUE value is "@0@" instead of ""'.format(have))
6868

69+
# Check if prefix array works properly and has the expected order
70+
have = cc.get_define('MESON_FAIL_VALUE', prefix: ['#define MESON_FAIL_VALUE 1', '#undef MESON_FAIL_VALUE'])
71+
assert(have == '', 'MESON_FAIL_VALUE value is "@0@" instead of ""'.format(have))
72+
73+
have = cc.get_define('MESON_SUCCESS_VALUE', prefix: ['#undef MESON_SUCCESS_VALUE', '#define MESON_SUCCESS_VALUE 1'])
74+
assert(have == '1', 'MESON_SUCCESS_VALUE value is "@0@" instead of ""'.format(have))
75+
6976
# This is used in the test_preprocessor_checks_CPPFLAGS() unit test.
7077
have = cc.get_define('MESON_TEST_DEFINE_VALUE')
7178
expect = get_option('MESON_TEST_DEFINE_VALUE')

0 commit comments

Comments
 (0)