summaryrefslogtreecommitdiff
path: root/deps/Unity/examples/example_1/meson.build
blob: 645eeb99cfd5a1a38fc21d6d956ad6569167e9c8 (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
48
project('Unity example', 'c',
  license: 'MIT',
  default_options: [
    'c_std=c99',
    'warning_level=3',
  ],
  meson_version: '>= 0.49.0'
)

unity_subproject = subproject('unity')
unity_dependency = unity_subproject.get_variable('unity_dep')
unity_gen_runner = unity_subproject.get_variable('gen_test_runner')

src1 = files([
  'src' / 'ProductionCode.c',
  'test' / 'TestProductionCode.c',
])

src2 = files([
  'src' / 'ProductionCode2.c',
  'test' / 'TestProductionCode2.c',
])

inc = include_directories('src')

test1 = executable('test1',
  sources: [
    src1,
    unity_gen_runner.process('test' / 'TestProductionCode.c')
  ],
  include_directories: [ inc ],
  dependencies: [ unity_dependency ],
)

test('test1', test1,
  should_fail: true)

test2 = executable('test2',
  sources: [
    src2,
    unity_gen_runner.process('test' / 'TestProductionCode2.c')
  ],
  include_directories: [ inc ],
  dependencies: [ unity_dependency ],
)

test('test2', test2)