aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/168 disabler/meson.build
blob: 7ca82b78663e5e4a8eb0079f89dafdd802cd0c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
project('dolphin option', 'c')

d = disabler()

d2 = dependency(d)
d3 = (d == d2)
d4 = d + 0
d5 = d2 or true

assert(d, 'Disabler did not cause this to be skipped.')
assert(d2, 'Function laundered disabler did not cause this to be skipped.')
assert(d3, 'Disabler comparison should yield disabler and thus this would not be called.')
assert(d4, 'Disabler addition should yield disabler and thus this would not be called.')
assert(d5, 'Disabler logic op should yield disabler and thus this would not be called.')

number = 0

if d
  number = 1
else
  number = 2
endif

assert(d == 0, 'Plain if handled incorrectly, value should be 0 but is @0@'.format(number))

if d.found()
  number = 1
else
  number = 2
endif

assert(d == 1, 'If found handled incorrectly, value should be 1 but is @0@'.format(number))