1project('Unity example', 'c',
2  license: 'MIT',
3  default_options: [
4    'c_std=c99',
5    'warning_level=3',
6  ],
7  meson_version: '>= 0.49.0'
8)
9
10unity_subproject = subproject('unity')
11unity_dependency = unity_subproject.get_variable('unity_dep')
12unity_gen_runner = unity_subproject.get_variable('gen_test_runner')
13
14src1 = files([
15  'src' / 'ProductionCode.c',
16  'test' / 'TestProductionCode.c',
17])
18
19src2 = files([
20  'src' / 'ProductionCode2.c',
21  'test' / 'TestProductionCode2.c',
22])
23
24inc = include_directories('src')
25
26test1 = executable('test1',
27  sources: [
28    src1,
29    unity_gen_runner.process('test' / 'TestProductionCode.c')
30  ],
31  include_directories: [ inc ],
32  dependencies: [ unity_dependency ],
33)
34
35test('test1', test1,
36  should_fail: true)
37
38test2 = executable('test2',
39  sources: [
40    src2,
41    unity_gen_runner.process('test' / 'TestProductionCode2.c')
42  ],
43  include_directories: [ inc ],
44  dependencies: [ unity_dependency ],
45)
46
47test('test2', test2)
48
49