summaryrefslogtreecommitdiff
path: root/test cases/common/261 testcase clause/meson.build
blob: 834865f2c087a368d92c15fc500fc9fb1f81c294 (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
35
36
37
project('testcase clause')

# To make sure unreachable code is not executed.
unreachable = true

# Verify assertion exception gets catched and dropped.
testcase expect_error('Assert failed: false')
  assert(false)
  unreachable = false
endtestcase
assert(unreachable)

# The inner testcase raises an exception because it did not receive the expected
# error message. The outer testcase catches the inner testcase exception and
# drop it.
testcase expect_error('Expecting error \'something\' but got \'Assert failed: false\'')
  testcase expect_error('something')
    assert(false)
    unreachable = false
  endtestcase
  unreachable = false
endtestcase
assert(unreachable)

# The inner testcase raises an exception because it did not receive an
# exception. The outer testcase catches the inner testcase exception and
# drop it.
testcase expect_error('Expecting an error but code block succeeded')
  testcase expect_error('something')
    reached = true
  endtestcase
  unreachable = false
endtestcase
assert(reached)
assert(unreachable)

message('all good')