43 # overflow-fallback handled separately below
61 'spawn-multithreaded',
82 if host_machine.system() != 'windows'
83 glib_tests += [ 'unix', 'include' ]
86 if cc.get_id() != 'msvc'
87 glib_tests += [ 'autoptr' ]
90 # FIXME: use new environment() object
91 # Not entirely random of course, but at least it changes over time
92 random_number = minor_version + meson.version().split('.').get(1).to_int()
95 'G_TEST_SRCDIR=' + meson.current_source_dir(),
96 'G_TEST_BUILDDIR=' + meson.current_build_dir(),
97 'G_DEBUG=gc-friendly',
99 'MALLOC_PERTURB_=@0@'.format(random_number % 256),
102 test_cargs = ['-DG_LOG_DOMAIN="GLib"']
104 # Tests that consistently time out on the CI infrastructure
111 foreach test_name : glib_tests
112 deps = [libm, thread_dep, libglib_dep]
113 source = test_name + '.c'
114 c_args = test_cargs + ['-DPCRE_STATIC']
115 if test_name == 'regex'
118 if test_name == 'gdatetime'
121 # We build the refcount test twice: one to test the function-based API,
122 # and the other to test the macro-based API that is used when disabling
124 if test_name == 'refcount-macro'
125 source = 'refcount.c'
126 c_args += ['-DG_DISABLE_CHECKS']
128 exe = executable(test_name, source,
133 # These tests may take more than 30 seconds to run on the CI infrastructure
134 if slow_tests.contains(test_name)
135 test(test_name, exe, env : test_env, timeout : 120, suite : ['glib', 'slow'])
137 test(test_name, exe, env : test_env, suite : ['glib'])
142 if cc.get_id() == 'gcc'
143 c_args_atomic += ['-Wstrict-aliasing=2']
146 deps = [libm, thread_dep, libglib_dep]
148 exe = executable('atomic', 'atomic.c',
149 c_args : test_cargs + c_args_atomic,
152 test('atomic', exe, env : test_env, suite : ['glib'])
154 # FIXME: consolidate all of these into the array
155 exe = executable('overflow-fallback', 'overflow.c',
156 c_args : test_cargs + ['-D_GLIB_TEST_OVERFLOW_FALLBACK'],
160 test('overflow-fallback', exe, env : test_env, suite : ['glib'])
162 exe = executable('642026-ec', '642026.c',
163 c_args : test_cargs + ['-DG_ERRORCHECK_MUTEXES'],
167 test('642026-ec', exe, env : test_env, timeout : 90, suite : ['glib', 'slow'])
169 exe = executable('1bit-emufutex', '1bit-mutex.c',
170 c_args : test_cargs + ['-DTEST_EMULATED_FUTEX'],
174 test('1bit-emufutex', exe, env : test_env, suite : ['glib'])
176 exe = executable('gwakeup', 'gwakeuptest.c', '../gwakeup.c',
180 test('gwakeup', exe, env : test_env, suite : ['glib'])
182 if glib_conf.has('HAVE_EVENTFD')
183 exe = executable('gwakeup-fallback', 'gwakeuptest.c', '../gwakeup.c',
184 c_args : test_cargs + ['-DTEST_EVENTFD_FALLBACK'],
188 test('gwakeup-fallback', exe, env : test_env, suite : ['glib'])
191 # test-spawn-echo helper binary required by the spawn tests above
192 executable('test-spawn-echo', 'test-spawn-echo.c',
198 # some testing of gtester functionality
199 if not meson.is_cross_build() and host_system != 'windows'
200 xmllint = find_program('xmllint', required: false)
202 tmpsample_xml = custom_target('tmpsample.xml',
203 output : 'tmpsample.xml',
204 build_by_default : true, # hack around meson bug, see PR #1335
205 command : [ gtester, '-k', '--quiet', '-o', '@OUTPUT@',
206 '--test-arg=--gtester-selftest', gtester])
208 test('gtester-xmllint-check', xmllint,
209 args : ['--noout', tmpsample_xml],