43 # overflow-fallback handled separately below
59 'spawn-multithreaded',
80 if host_machine.system() != 'windows'
81 glib_tests += [ 'unix', 'include' ]
84 if cc.get_id() != 'msvc'
85 glib_tests += [ 'autoptr' ]
88 # FIXME: use new environment() object
89 # Not entirely random of course, but at least it changes over time
90 random_number = minor_version + meson.version().split('.').get(1).to_int()
93 'G_TEST_SRCDIR=' + meson.current_source_dir(),
94 'G_TEST_BUILDDIR=' + meson.current_build_dir(),
95 'G_DEBUG=gc-friendly',
97 'MALLOC_PERTURB_=@0@'.format(random_number % 256),
100 test_cargs = ['-DG_LOG_DOMAIN="GLib"']
102 # Tests that consistently time out on the CI infrastructure
109 foreach test_name : glib_tests
110 deps = [libm, thread_dep, libglib_dep]
111 if test_name == 'regex'
114 if test_name == 'gdatetime'
117 exe = executable(test_name, '@0@.c'.format(test_name),
118 c_args : ['-DPCRE_STATIC'] + test_cargs,
122 # These tests may take more than 30 seconds to run on the CI infrastructure
123 if slow_tests.contains(test_name)
124 test(test_name, exe, env : test_env, timeout : 120, suite : ['glib', 'slow'])
126 test(test_name, exe, env : test_env, suite : ['glib'])
131 if cc.get_id() == 'gcc'
132 c_args_atomic += ['-Wstrict-aliasing=2']
135 deps = [libm, thread_dep, libglib_dep]
137 exe = executable('atomic', 'atomic.c',
138 c_args : test_cargs + c_args_atomic,
141 test('atomic', exe, env : test_env, suite : ['glib'])
143 # FIXME: consolidate all of these into the array
144 exe = executable('overflow-fallback', 'overflow.c',
145 c_args : test_cargs + ['-D_GLIB_TEST_OVERFLOW_FALLBACK'],
149 test('overflow-fallback', exe, env : test_env, suite : ['glib'])
151 exe = executable('642026-ec', '642026.c',
152 c_args : test_cargs + ['-DG_ERRORCHECK_MUTEXES'],
156 test('642026-ec', exe, env : test_env, timeout : 90, suite : ['glib', 'slow'])
158 exe = executable('1bit-emufutex', '1bit-mutex.c',
159 c_args : test_cargs + ['-DTEST_EMULATED_FUTEX'],
163 test('1bit-emufutex', exe, env : test_env, suite : ['glib'])
165 exe = executable('gwakeup', 'gwakeuptest.c', '../gwakeup.c',
169 test('gwakeup', exe, env : test_env, suite : ['glib'])
171 if glib_conf.has('HAVE_EVENTFD')
172 exe = executable('gwakeup-fallback', 'gwakeuptest.c', '../gwakeup.c',
173 c_args : test_cargs + ['-DTEST_EVENTFD_FALLBACK'],
177 test('gwakeup-fallback', exe, env : test_env, suite : ['glib'])
180 # test-spawn-echo helper binary required by the spawn tests above
181 executable('test-spawn-echo', 'test-spawn-echo.c',
187 # some testing of gtester functionality
188 if not meson.is_cross_build() and host_system != 'windows'
189 xmllint = find_program('xmllint', required: false)
191 tmpsample_xml = custom_target('tmpsample.xml',
192 output : 'tmpsample.xml',
193 build_by_default : true, # hack around meson bug, see PR #1335
194 command : [ gtester, '-k', '--quiet', '-o', '@OUTPUT@',
195 '--test-arg=--gtester-selftest', gtester])
197 test('gtester-xmllint-check', xmllint,
198 args : ['--noout', tmpsample_xml],