42 # overflow-fallback handled separately below
58 'spawn-multithreaded',
79 if host_machine.system() != 'windows'
80 glib_tests += [ 'unix', 'include' ]
83 if cc.get_id() != 'msvc'
84 glib_tests += [ 'autoptr' ]
87 # FIXME: use new environment() object
88 # Not entirely random of course, but at least it changes over time
89 random_number = minor_version + meson.version().split('.').get(1).to_int()
92 'G_TEST_SRCDIR=' + meson.current_source_dir(),
93 'G_TEST_BUILDDIR=' + meson.current_build_dir(),
94 'G_DEBUG=gc-friendly',
96 'MALLOC_PERTURB_=@0@'.format(random_number % 256),
99 test_cargs = ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib"']
101 # Tests that consistently time out on the CI infrastructure
108 foreach test_name : glib_tests
109 deps = [libm, thread_dep, libglib_dep]
110 if test_name == 'regex'
113 exe = executable(test_name, '@0@.c'.format(test_name),
114 c_args : ['-DPCRE_STATIC'] + test_cargs,
118 # These tests may take more than 30 seconds to run on the CI infrastructure
119 if slow_tests.contains(test_name)
120 test(test_name, exe, env : test_env, timeout : 90)
122 test(test_name, exe, env : test_env)
127 if cc.get_id() == 'gcc'
128 c_args_atomic += ['-Wstrict-aliasing=2']
131 deps = [libm, thread_dep, libglib_dep]
133 exe = executable('atomic', 'atomic.c',
134 c_args : test_cargs + c_args_atomic,
137 test('atomic', exe, env : test_env)
139 # FIXME: consolidate all of these into the array
140 exe = executable('overflow-fallback', 'overflow.c',
141 c_args : test_cargs + ['-D_GLIB_TEST_OVERFLOW_FALLBACK'],
145 test('overflow-fallback', exe, env : test_env)
147 exe = executable('642026-ec', '642026.c',
148 c_args : test_cargs + ['-DG_ERRORCHECK_MUTEXES'],
152 test('642026-ec', exe, env : test_env, timeout : 45)
154 exe = executable('1bit-emufutex', '1bit-mutex.c',
155 c_args : test_cargs + ['-DTEST_EMULATED_FUTEX'],
159 test('1bit-emufutex', exe, env : test_env)
161 exe = executable('gwakeup', 'gwakeuptest.c', '../gwakeup.c',
165 test('gwakeup', exe, env : test_env)
167 if glib_conf.has('HAVE_EVENTFD')
168 exe = executable('gwakeup-fallback', 'gwakeuptest.c', '../gwakeup.c',
169 c_args : test_cargs + ['-DTEST_EVENTFD_FALLBACK'],
173 test('gwakeup-fallback', exe, env : test_env)
176 # test-spawn-echo helper binary required by the spawn tests above
177 executable('test-spawn-echo', 'test-spawn-echo.c',
183 # some testing of gtester functionality
184 if not meson.is_cross_build() and host_system != 'windows'
185 xmllint = find_program('xmllint', required: false)
187 tmpsample_xml = custom_target('tmpsample.xml',
188 output : 'tmpsample.xml',
189 build_by_default : true, # hack around meson bug, see PR #1335
190 command : [ gtester, '-k', '--quiet', '-o', '@OUTPUT@',
191 '--test-arg=--gtester-selftest', gtester])
193 test('gtester-xmllint-check', xmllint,
194 args : ['--noout', tmpsample_xml],