| 1 |
testexecdir = join_paths(installed_test_bindir, 'gdk') |
| 2 |
testdatadir = join_paths(installed_test_datadir, 'gdk') |
| 3 |
|
| 4 |
clipboard_client = executable('clipboard-client', |
| 5 |
sources: ['clipboard-client.c'], |
| 6 |
include_directories: [confinc], |
| 7 |
c_args: common_cflags, |
| 8 |
dependencies: [ libgtk_dep ], |
| 9 |
install: get_option('install-tests'), |
| 10 |
install_dir: testexecdir |
| 11 |
) |
| 12 |
|
| 13 |
tests = [ |
| 14 |
{ 'name': 'array' }, |
| 15 |
{ 'name': 'cairo' }, |
| 16 |
{ 'name': 'clipboard', 'parallel': false, 'suites': 'flaky' }, |
| 17 |
{ 'name': 'contentformats' }, |
| 18 |
{ 'name': 'contentserializer' }, |
| 19 |
{ 'name': 'cursor' }, |
| 20 |
{ 'name': 'displaymanager' }, |
| 21 |
{ 'name': 'glcontext' }, |
| 22 |
{ 'name': 'keysyms' }, |
| 23 |
{ 'name': 'rectangle' }, |
| 24 |
{ 'name': 'rgba' }, |
| 25 |
{ 'name': 'seat' }, |
| 26 |
{ 'name': 'texture-threads' }, |
| 27 |
{ 'name': 'toplevellayout' }, |
| 28 |
{ 'name': 'popuplayout' }, |
| 29 |
] |
| 30 |
|
| 31 |
if x11_enabled |
| 32 |
tests += [ |
| 33 |
{ 'name': 'display' }, |
| 34 |
{ 'name': 'encoding' }, |
| 35 |
] |
| 36 |
endif |
| 37 |
|
| 38 |
if os_linux |
| 39 |
tests += [ |
| 40 |
{ 'name': 'dmabuf-support', |
| 41 |
'sources': [ 'udmabuf.c' ], |
| 42 |
# This needs to pass on upstream Gitlab-CI, but cannot be guaranteed |
| 43 |
# to work on developer machines or downstream build environments |
| 44 |
'suites': [ 'needs-udmabuf' ], |
| 45 |
}, |
| 46 |
{ 'name': 'colorstate', |
| 47 |
'sources': [ 'udmabuf.c' ], |
| 48 |
}, |
| 49 |
] |
| 50 |
else |
| 51 |
tests += [ |
| 52 |
{ 'name': 'colorstate' } |
| 53 |
] |
| 54 |
endif |
| 55 |
|
| 56 |
foreach t : tests |
| 57 |
test_name = t.get('name') |
| 58 |
test_exe = executable(test_name, |
| 59 |
sources: [ '@[email protected]'.format(test_name) ] + t.get('sources', []), |
| 60 |
c_args: common_cflags, |
| 61 |
dependencies: libgtk_dep, |
| 62 |
install: get_option('install-tests'), |
| 63 |
install_dir: testexecdir, |
| 64 |
) |
| 65 |
|
| 66 |
suites = ['gdk'] + t.get('suites', []) |
| 67 |
|
| 68 |
test(test_name, test_exe, |
| 69 |
args: [ '--tap', '-k' ], |
| 70 |
protocol: 'tap', |
| 71 |
is_parallel: t.get('parallel', false), |
| 72 |
env: [ |
| 73 |
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), |
| 74 |
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), |
| 75 |
'DBUS_SESSION_BUS_ADDRESS=', |
| 76 |
], |
| 77 |
suite: suites, |
| 78 |
) |
| 79 |
endforeach |
| 80 |
|
| 81 |
internal_tests = [ |
| 82 |
{ 'name': 'colorstate-internal' }, |
| 83 |
{ 'name': 'dihedral' }, |
| 84 |
{ 'name': 'image' }, |
| 85 |
{ 'name': 'memorytexture', 'sources': [ 'gdktestutils.c' ] }, |
| 86 |
{ 'name': 'mipmap', 'sources': [ 'gdktestutils.c' ] }, |
| 87 |
{ 'name': 'texture' }, |
| 88 |
{ 'name': 'gltexture' }, |
| 89 |
{ 'name': 'subsurface' }, |
| 90 |
{ 'name': 'memoryformat' }, |
| 91 |
] |
| 92 |
|
| 93 |
internal_test_executables = [] |
| 94 |
|
| 95 |
if os_linux |
| 96 |
internal_tests += { 'name': 'dmabufformats' } |
| 97 |
internal_tests += { 'name': 'dmabuftexture', 'suites': 'failing' } |
| 98 |
|
| 99 |
internal_test_executables += { 'name': 'waylandsocket' } |
| 100 |
endif |
| 101 |
|
| 102 |
foreach t : internal_tests |
| 103 |
test_name = t.get('name') |
| 104 |
test_exe = executable(test_name, |
| 105 |
sources: [ '@[email protected]'.format(test_name) ] + t.get('sources', []), |
| 106 |
c_args: common_cflags + ['-DGTK_COMPILATION'], |
| 107 |
dependencies: libgtk_static_dep, |
| 108 |
install: get_option('install-tests'), |
| 109 |
install_dir: testexecdir, |
| 110 |
) |
| 111 |
|
| 112 |
suites = ['gdk'] + t.get('suites', []) |
| 113 |
|
| 114 |
test(test_name, test_exe, |
| 115 |
args: [ '--tap', '-k' ], |
| 116 |
protocol: 'tap', |
| 117 |
env: [ |
| 118 |
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), |
| 119 |
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), |
| 120 |
'DBUS_SESSION_BUS_ADDRESS=', |
| 121 |
], |
| 122 |
suite: suites, |
| 123 |
) |
| 124 |
endforeach |
| 125 |
|
| 126 |
test_executables = {} |
| 127 |
foreach t : internal_test_executables |
| 128 |
test_name = t.get('name') |
| 129 |
test_executable = executable(test_name, |
| 130 |
sources: [ '@[email protected]'.format(test_name) ] + t.get('sources', []), |
| 131 |
c_args: common_cflags + ['-DGTK_COMPILATION'], |
| 132 |
dependencies: libgtk_static_dep, |
| 133 |
install: false, |
| 134 |
) |
| 135 |
test_executables += {test_name: test_executable} |
| 136 |
endforeach |
| 137 |
|
| 138 |
|
| 139 |
if get_option('install-tests') |
| 140 |
foreach t : tests |
| 141 |
test_name = t.get('name') |
| 142 |
suites = t.get('suites', []) |
| 143 |
|
| 144 |
if suites.contains('flaky') or suites.contains('failing') |
| 145 |
continue |
| 146 |
endif |
| 147 |
|
| 148 |
test_cdata = configuration_data() |
| 149 |
test_cdata.set('testexecdir', testexecdir) |
| 150 |
test_cdata.set('test', test_name) |
| 151 |
configure_file(input: 'gdk.test.in', |
| 152 |
output: '@[email protected]'.format(test_name), |
| 153 |
configuration: test_cdata, |
| 154 |
install: true, |
| 155 |
install_dir: testdatadir, |
| 156 |
) |
| 157 |
endforeach |
| 158 |
|
| 159 |
install_subdir('clipboard-data', install_dir: testexecdir) |
| 160 |
install_subdir('image-data', install_dir: testexecdir) |
| 161 |
endif |