summaryrefslogtreecommitdiff
path: root/tests/repository/meson.build
blob: 497ab106a8804b0164f1fa5a40828967da40f11b (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
if glib_dep.type_name() == 'pkgconfig'

  repository_tests = {
    'gitestrepo': typelibs,
    'giteststructinfo': typelibs,
    'gitestthrows': typelibs,
    'gitypelibtest': [regress_typelib],
  }

  repository_test_env = environment()
  repository_test_env.prepend(
    'GI_TYPELIB_PATH',
    join_paths(meson.build_root(), 'gir'),
    join_paths(meson.build_root(), 'tests'),
    join_paths(meson.build_root(), 'tests', 'scanner'),
  )
  repository_test_env.prepend(
    'LD_LIBRARY_PATH',
    join_paths(meson.build_root(), 'tests', 'scanner'),
  )
  if host_system == 'windows'
    repository_test_env.prepend(
      'PATH', join_paths(meson.build_root(), 'tests', 'scanner'))
  endif

  custom_c_args = cc.get_supported_arguments([
    '-Wno-unused-parameter',
  ])

  foreach test_name, depends : repository_tests
    source = files(test_name + '.c')
    exe = executable(test_name, source,
      dependencies: [girepo_dep],
      c_args: custom_c_args)
    test(test_name, exe, env: repository_test_env, depends: depends)
  endforeach
endif