summaryrefslogtreecommitdiff
path: root/tests/meson.build
blob: 70aeb72aa4b61e85e0df839a74f755c36efc9033 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
if enable_gir and has_dbusmock
  c_execs = []
  c_exec = executable('test_battery',
    'test_battery.c',
    include_directories: lib_inc,
    dependencies: deps,
    c_args: cflags,
    link_with: libgnome_bluetooth,
  )
  c_execs += [c_exec]

  integration_test = find_program('integration-test.py')

  envs = environment()
  envs.set ('top_builddir', meson.global_build_root())
  envs.set ('top_srcdir', meson.global_source_root())

  test_deps = [ gnomebt_priv_gir, c_exec ]

  python3 = find_program('python3')
  unittest_inspector = find_program('unittest_inspector.py')
  r = run_command(unittest_inspector, files('integration-test.py'), check: true)
  unit_tests = r.stdout().strip().split('\n')

  foreach ut: unit_tests
    ut_args = files('integration-test.py')
    ut_args += ut
    test(ut,
      python3,
      args: ut_args,
      env: envs,
      depends: test_deps
    )
  endforeach
endif

if not has_dbusmock
  test('integration-test-skipped',
    find_program('integration-test-skipped.sh'),
  )
endif

test_bluetooth_device = executable('test-bluetooth-device',
  'test-bluetooth-device.c',
  include_directories: lib_inc,
  dependencies: deps,
  c_args: cflags,
  link_with: libgnome_bluetooth,
)

test('test-bluetooth-device-test',
  test_bluetooth_device,
)

test_bluetooth_utils = executable('test-bluetooth-utils',
  [ 'test-bluetooth-utils.c', enum_sources ],
  include_directories: [ top_inc, lib_inc],
  dependencies: deps,
  c_args: cflags,
  link_with: libgnome_bluetooth,
)

test('test-bluetooth-device-utils',
  test_bluetooth_utils,
)