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 foreach test_name : glib_tests
102 deps = [libm, thread_dep, libglib_dep]
103 if test_name == 'regex'
106 exe = executable(test_name, '@0@.c'.format(test_name),
107 c_args : ['-DPCRE_STATIC'] + test_cargs,
111 test(test_name, exe, env : test_env)
115 if cc.get_id() == 'gcc'
116 c_args_atomic += ['-Wstrict-aliasing=2']
119 deps = [libm, thread_dep, libglib_dep]
121 exe = executable('atomic', 'atomic.c',
122 c_args : test_cargs + c_args_atomic,
125 test('atomic', exe, env : test_env)
127 # FIXME: consolidate all of these into the array
128 exe = executable('overflow-fallback', 'overflow.c',
129 c_args : test_cargs + ['-D_GLIB_TEST_OVERFLOW_FALLBACK'],
133 test('overflow-fallback', exe, env : test_env)
135 exe = executable('642026-ec', '642026.c',
136 c_args : test_cargs + ['-DG_ERRORCHECK_MUTEXES'],
140 test('642026-ec', exe, env : test_env)
142 exe = executable('1bit-emufutex', '1bit-mutex.c',
143 c_args : test_cargs + ['-DTEST_EMULATED_FUTEX'],
147 test('1bit-emufutex', exe, env : test_env)
149 exe = executable('gwakeup', 'gwakeuptest.c', '../gwakeup.c',
153 test('gwakeup', exe, env : test_env)
155 if glib_conf.has('HAVE_EVENTFD')
156 exe = executable('gwakeup-fallback', 'gwakeuptest.c', '../gwakeup.c',
157 c_args : test_cargs + ['-DTEST_EVENTFD_FALLBACK'],
161 test('gwakeup-fallback', exe, env : test_env)
164 # test-spawn-echo helper binary required by the spawn tests above
165 executable('test-spawn-echo', 'test-spawn-echo.c',
171 # some testing of gtester functionality
172 if not meson.is_cross_build() and host_system != 'windows'
173 xmllint = find_program('xmllint', required: false)
175 tmpsample_xml = custom_target('tmpsample.xml',
176 output : 'tmpsample.xml',
177 build_by_default : true, # hack around meson bug, see PR #1335
178 command : [ gtester, '-k', '--quiet', '-o', '@OUTPUT@',
179 '--test-arg=--gtester-selftest', gtester])
181 test('gtester-xmllint-check', xmllint,
182 args : ['--noout', tmpsample_xml],