Debian Codegraph @

testsuite/gtk/meson.build

raw
1 gtk_tests_export_dynamic_ldflag = []
2
3 if cc.get_id() != 'msvc' and cc.get_id() != 'clang'
4 gtk_tests_export_dynamic_ldflag = ['-Wl,--export-dynamic']
5 endif
6
7 tests = [
8 ['accel'],
9 ['accessible'],
10 ['action'],
11 ['adjustment'],
12 ['bitmask', ['../../gtk/gtkallocatedbitmask.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']],
13 ['builder', [], [], gtk_tests_export_dynamic_ldflag],
14 ['builderparser'],
15 ['cellarea'],
16 ['check-icon-names'],
17 ['check-cursor-names'],
18 ['cssprovider'],
19 ['defaultvalue'],
20 ['entry'],
21 ['firefox-stylecontext'],
22 ['floating'],
23 ['focus'],
24 ['gestures'],
25 ['grid'],
26 ['gtkmenu'],
27 ['icontheme'],
28 ['keyhash', ['../../gtk/gtkkeyhash.c', gtkresources, '../../gtk/gtkprivate.c'], gtk_cargs],
29 ['listbox'],
30 ['notify'],
31 ['no-gtk-init'],
32 ['object'],
33 ['papersize'],
34 ['rbtree', ['../../gtk/gtkrbtree.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']],
35 ['recentmanager'],
36 ['regression-tests'],
37 ['scrolledwindow'],
38 ['spinbutton'],
39 ['stylecontext'],
40 ['templates'],
41 ['textbuffer'],
42 ['textiter'],
43 ['treemodel', ['treemodel.c', 'liststore.c', 'treestore.c', 'filtermodel.c',
44 'modelrefcount.c', 'sortmodel.c', 'gtktreemodelrefcount.c']],
45 ['treepath'],
46 ['treeview'],
47 ['typename'],
48 ['window'],
49 ['displayclose'],
50 ['revealer-size'],
51 ]
52
53 # Tests that are expected to fail, sometimes or always
54 flaky = [
55 ]
56 xfail = [
57 ]
58
59 is_debug = get_option('buildtype').startswith('debug')
60
61 test_cargs = []
62
63 if os_unix
64 # tests += [['defaultvalue']] # disabled in Makefile.am as well
65 test_cargs += ['-DHAVE_UNIX_PRINT_WIDGETS']
66 endif
67
68 if x11_enabled
69 tests += [
70 ['clipboard'],
71 ['objects-finalize', ['../../gdk/x11/gdkdisplaymanager-x11.c'], ['-DGDK_COMPILATION', '-UG_ENABLE_DEBUG']],
72 ]
73 endif
74
75 foreach t : tests
76 test_name = t.get(0)
77 test_srcs = ['@[email protected]'.format(test_name)] + t.get(1, [])
78 test_extra_cargs = t.get(2, [])
79 test_extra_ldflags = t.get(3, [])
80
81 test_exe = executable(test_name, test_srcs,
82 c_args : test_cargs + test_extra_cargs,
83 link_args : test_extra_ldflags,
84 dependencies : libgtk_dep,
85 install: get_option('installed_tests'),
86 install_dir: installed_test_bindir)
87
88 suites = ['gtk']
89
90 if flaky.contains(test_name)
91 suites += 'flaky'
92 endif
93
94 if xfail.contains(test_name)
95 suites += 'failing'
96 endif
97
98 test(test_name, test_exe,
99 args: [ '--tap', '-k' ],
100 env: [ 'GIO_USE_VOLUME_MONITOR=unix',
101 'GSETTINGS_BACKEND=memory',
102 'GTK_CSD=1',
103 'G_ENABLE_DIAGNOSTIC=0',
104 'GSK_RENDERER=cairo',
105 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
106 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
107 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
108 'GTK_TEST_MESON=1',
109 ],
110 suite: suites,
111 )
112 endforeach
113
114 # FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++
115 if add_languages('cpp', required: false, native: false)
116 test_exe = executable('autotestkeywords',
117 'autotestkeywords.cc',
118 c_args : test_cargs + ['-Idummy-headers'],
119 dependencies : libgtk_dep,
120 install: get_option('installed_tests'),
121 install_dir: installed_test_bindir)
122 test('c++ keywords', test_exe,
123 args: [ '--tap', '-k' ],
124 env: [ 'GIO_USE_VOLUME_MONITOR=unix',
125 'GSETTINGS_BACKEND=memory',
126 'GTK_CSD=1',
127 'G_ENABLE_DIAGNOSTIC=0',
128 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
129 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
130 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
131 ],
132 suite: 'gtk')
133
134 if get_option('installed_tests')
135 conf = configuration_data()
136 conf.set('testexecdir', installed_test_bindir)
137 conf.set('test', 'autotestkeywords')
138 configure_file(input: 'gtk.test.in',
139 output: 'autotestkeywords.test',
140 configuration: conf,
141 install_dir: installed_test_datadir)
142 endif
143 endif
144
145
146 if get_option('installed_tests')
147 foreach t : tests
148 test_name = t.get(0)
149
150 if flaky.contains(test_name) or xfail.contains(test_name)
151 continue
152 endif
153
154 conf = configuration_data()
155 conf.set('testexecdir', installed_test_bindir)
156 conf.set('test', test_name)
157 configure_file(input: 'gtk.test.in',
158 output: '@[email protected]'.format(test_name),
159 configuration: conf,
160 install_dir: installed_test_datadir)
161 endforeach
162
163 install_subdir('icons', install_dir: installed_test_bindir)
164 install_subdir('icons2', install_dir: installed_test_bindir)
165 install_subdir('ui', install_dir: installed_test_bindir)
166 endif