aboutsummaryrefslogtreecommitdiff
path: root/test cases/rust/9 unit tests/meson.build
blob: 909601430dcb0d8baa2279643f258950920d25fd (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
38
39
40
41
42
43
44
45
46
47
project('rust unit tests', 'rust')

t = executable(
  'rust_test',
  ['test.rs'],
  rust_args : ['--test'],
)

test(
  'rust test (should fail)',
  t,
  protocol : 'rust',
  suite : ['foo'],
  should_fail : true,
)

test(
  'rust test (should pass)',
  t,
  args : ['--skip', 'test_add_intentional_fail'],
  protocol : 'rust',
  suite : ['foo'],
)


test(
  'rust test (should skip)',
  t,
  args : ['--skip', 'test_add'],
  protocol : 'rust',
  suite : ['foo'],
)

exe = executable('rust_exe', ['test2.rs', 'test.rs'])

rust = import('unstable-rust')
rust.test('rust_test_from_exe', exe, should_fail : true)

lib = static_library('rust_static', ['test.rs'])
rust.test('rust_test_from_static', lib, args: ['--skip', 'test_add_intentional_fail'])

lib = shared_library('rust_shared', ['test.rs'])
rust.test('rust_test_from_shared', lib, args: ['--skip', 'test_add_intentional_fail'])

helper = static_library('helper', 'helper.rs')
lib = static_library('rust_link_with', 'test3.rs')
rust.test('rust_test_link_with', lib, link_with : helper)