File: meson.build

package info (click to toggle)
gtk4 4.20.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 187,060 kB
  • sloc: ansic: 779,084; xml: 3,093; javascript: 3,054; python: 1,911; java: 752; sh: 682; makefile: 315; perl: 162; cpp: 21
file content (150 lines) | stat: -rw-r--r-- 3,861 bytes parent folder | download
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
testexecdir = join_paths(installed_test_bindir, 'gdk')
testdatadir = join_paths(installed_test_datadir, 'gdk')

clipboard_client = executable('clipboard-client',
  sources: ['clipboard-client.c'],
  include_directories: [confinc],
  c_args: common_cflags,
  dependencies: [ libgtk_dep ],
  install: get_option('install-tests'),
  install_dir: testexecdir
)

tests = [
  { 'name': 'array' },
  { 'name': 'cairo' },
  { 'name': 'clipboard', 'parallel': false, 'suites': 'flaky' },
  { 'name': 'contentformats' },
  { 'name': 'contentserializer' },
  { 'name': 'cursor' },
  { 'name': 'displaymanager' },
  { 'name': 'glcontext' },
  { 'name': 'keysyms' },
  { 'name': 'rectangle' },
  { 'name': 'rgba' },
  { 'name': 'seat' },
  { 'name': 'texture-threads' },
  { 'name': 'toplevellayout' },
  { 'name': 'popuplayout' },
]

if x11_enabled
  tests += [
    { 'name': 'display' },
    { 'name': 'encoding' },
  ]
endif

if os_linux
  tests += [
    { 'name': 'dmabuf-support',
      'sources': [ 'udmabuf.c' ],
      # This needs to pass on upstream Gitlab-CI, but cannot be guaranteed
      # to work on developer machines or downstream build environments
      'suites': [ 'needs-udmabuf' ],
    },
    { 'name': 'colorstate',
      'sources': [ 'udmabuf.c' ],
    },
  ]
else
  tests += [
    { 'name': 'colorstate' }
  ]
endif

foreach t : tests
  test_name = t.get('name')
  test_exe = executable(test_name,
    sources: [ '@0@.c'.format(test_name) ] + t.get('sources', []),
    c_args: common_cflags,
    dependencies: libgtk_dep,
    install: get_option('install-tests'),
    install_dir: testexecdir,
  )

  suites = ['gdk'] + t.get('suites', [])

  test(test_name, test_exe,
    args: [ '--tap', '-k' ],
    protocol: 'tap',
    is_parallel: t.get('parallel', false),
    env: [
      'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
      'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
      'DBUS_SESSION_BUS_ADDRESS=',
    ],
    suite: suites,
  )
endforeach

internal_tests = [
  { 'name': 'colorstate-internal' },
  { 'name': 'dihedral' },
  { 'name': 'image' },
  { 'name': 'memorytexture', 'sources': [ 'gdktestutils.c' ] },
  { 'name': 'mipmap', 'sources': [ 'gdktestutils.c' ] },
  { 'name': 'texture' },
  { 'name': 'gltexture' },
  { 'name': 'subsurface' },
  { 'name': 'memoryformat' },
]

if os_linux
  internal_tests += { 'name': 'dmabufformats' }
  internal_tests += { 'name': 'dmabuftexture', 'suites': 'failing' }
endif


foreach t : internal_tests
  test_name = t.get('name')
  test_exe = executable(test_name,
    sources: [ '@0@.c'.format(test_name) ] + t.get('sources', []),
    c_args: common_cflags + ['-DGTK_COMPILATION'],
    dependencies: libgtk_static_dep,
    install: get_option('install-tests'),
    install_dir: testexecdir,
  )

  suites = ['gdk'] + t.get('suites', [])

  if host_machine.endian() == 'big' and t.get('name') == 'gltexture'
    suites += 'failing'
  endif

  test(test_name, test_exe,
    args: [ '--tap', '-k' ],
    protocol: 'tap',
    env: [
      'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
      'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
      'DBUS_SESSION_BUS_ADDRESS=',
    ],
    suite: suites,
  )
endforeach


if get_option('install-tests')
  foreach t : tests
    test_name = t.get('name')
    suites = t.get('suites', [])

    if suites.contains('flaky') or suites.contains('failing')
      continue
    endif

    test_cdata = configuration_data()
    test_cdata.set('testexecdir', testexecdir)
    test_cdata.set('test', test_name)
    configure_file(input: 'gdk.test.in',
      output: '@0@.test'.format(test_name),
      configuration: test_cdata,
      install: true,
      install_dir: testdatadir,
    )
  endforeach

  install_subdir('clipboard-data', install_dir: testexecdir)
  install_subdir('image-data', install_dir: testexecdir)
endif