44 # overflow-fallback handled separately below
64 'spawn-multithreaded',
85 if host_machine.system() != 'windows'
86 glib_tests += [ 'unix', 'include' ]
89 if cc.get_id() != 'msvc'
90 glib_tests += [ 'autoptr' ]
93 # FIXME: use new environment() object
94 # Not entirely random of course, but at least it changes over time
95 random_number = minor_version + meson.version().split('.').get(1).to_int()
98 'G_TEST_SRCDIR=' + meson.current_source_dir(),
99 'G_TEST_BUILDDIR=' + meson.current_build_dir(),
100 'G_DEBUG=gc-friendly',
102 'MALLOC_PERTURB_=@0@'.format(random_number % 256),
105 test_cargs = ['-DG_LOG_DOMAIN="GLib"']
107 # Tests that consistently time out on the CI infrastructure
114 foreach test_name : glib_tests
115 deps = [libm, thread_dep, libglib_dep]
116 source = test_name + '.c'
117 c_args = test_cargs + ['-DPCRE_STATIC']
118 if test_name == 'regex'
121 if test_name == 'gdatetime'
124 # We build the refcount test twice: one to test the function-based API,
125 # and the other to test the macro-based API that is used when disabling
127 if test_name == 'refcount-macro'
128 source = 'refcount.c'
129 c_args += ['-DG_DISABLE_CHECKS']
131 exe = executable(test_name, source,
136 # These tests may take more than 30 seconds to run on the CI infrastructure
137 if slow_tests.contains(test_name)
138 test(test_name, exe, env : test_env, timeout : 120, suite : ['glib', 'slow'])
140 test(test_name, exe, env : test_env, suite : ['glib'])
145 if cc.get_id() == 'gcc'
146 c_args_atomic += ['-Wstrict-aliasing=2']
149 deps = [libm, thread_dep, libglib_dep]
151 exe = executable('atomic', 'atomic.c',
152 c_args : test_cargs + c_args_atomic,
155 test('atomic', exe, env : test_env, suite : ['glib'])
157 # FIXME: consolidate all of these into the array
158 exe = executable('overflow-fallback', 'overflow.c',
159 c_args : test_cargs + ['-D_GLIB_TEST_OVERFLOW_FALLBACK'],
163 test('overflow-fallback', exe, env : test_env, suite : ['glib'])
165 exe = executable('642026-ec', '642026.c',
166 c_args : test_cargs + ['-DG_ERRORCHECK_MUTEXES'],
170 test('642026-ec', exe, env : test_env, timeout : 90, suite : ['glib', 'slow'])
172 exe = executable('1bit-emufutex', '1bit-mutex.c',
173 c_args : test_cargs + ['-DTEST_EMULATED_FUTEX'],
177 test('1bit-emufutex', exe, env : test_env, suite : ['glib'])
179 exe = executable('gwakeup', 'gwakeuptest.c', '../gwakeup.c',
183 test('gwakeup', exe, env : test_env, suite : ['glib'])
185 if glib_conf.has('HAVE_EVENTFD')
186 exe = executable('gwakeup-fallback', 'gwakeuptest.c', '../gwakeup.c',
187 c_args : test_cargs + ['-DTEST_EVENTFD_FALLBACK'],
191 test('gwakeup-fallback', exe, env : test_env, suite : ['glib'])
194 # test-spawn-echo helper binary required by the spawn tests above
195 executable('test-spawn-echo', 'test-spawn-echo.c',
201 # some testing of gtester functionality
202 if not meson.is_cross_build() and host_system != 'windows'
203 xmllint = find_program('xmllint', required: false)
205 tmpsample_xml = custom_target('tmpsample.xml',
206 output : 'tmpsample.xml',
207 build_by_default : true, # hack around meson bug, see PR #1335
208 command : [ gtester, '-k', '--quiet', '-o', '@OUTPUT@',
209 '--test-arg=--gtester-selftest', gtester])
211 test('gtester-xmllint-check', xmllint,
212 args : ['--noout', tmpsample_xml],