2022-06-08 12:29:15 +02:00
|
|
|
subdir('performance')
|
|
|
|
|
2017-07-17 11:54:28 +02:00
|
|
|
marshalers_h = custom_target('marshalers_h',
|
|
|
|
output : 'marshalers.h',
|
|
|
|
input : 'marshalers.list',
|
|
|
|
command : [
|
|
|
|
python, glib_genmarshal,
|
|
|
|
'--prefix=test',
|
|
|
|
'--valist-marshallers',
|
|
|
|
'--output=@OUTPUT@',
|
|
|
|
'--quiet',
|
|
|
|
'--header',
|
|
|
|
'@INPUT@',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
marshalers_c = custom_target('marshalers_c',
|
|
|
|
output : 'marshalers.c',
|
|
|
|
input : 'marshalers.list',
|
|
|
|
command : [
|
|
|
|
python, glib_genmarshal,
|
|
|
|
'--prefix=test',
|
|
|
|
'--valist-marshallers',
|
|
|
|
'--include-header=marshalers.h',
|
|
|
|
'--output=@OUTPUT@',
|
|
|
|
'--quiet',
|
|
|
|
'--body',
|
|
|
|
'@INPUT@',
|
|
|
|
],
|
|
|
|
)
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2018-08-15 15:45:06 +02:00
|
|
|
gobject_tests = {
|
2022-06-08 17:56:25 +02:00
|
|
|
'notify-init' : {},
|
2022-06-10 02:11:08 +02:00
|
|
|
'notify-init2' : {},
|
2022-07-07 19:44:22 +02:00
|
|
|
'custom-dispatch' : {},
|
2018-08-15 15:45:06 +02:00
|
|
|
'qdata' : {},
|
2022-03-13 19:44:31 +01:00
|
|
|
'accumulator' : {
|
|
|
|
'source' : ['accumulator.c', marshalers_h, marshalers_c],
|
|
|
|
},
|
2022-05-27 22:31:13 +02:00
|
|
|
'basics-gobject' : {},
|
2018-08-15 15:45:06 +02:00
|
|
|
'boxed' : {},
|
2022-03-13 19:44:31 +01:00
|
|
|
'defaultiface' : {
|
|
|
|
'source' : ['defaultiface.c', 'testmodule.c'],
|
|
|
|
},
|
2022-12-15 22:09:17 +01:00
|
|
|
'deftype' : { 'protocol': 'exitcode' },
|
2022-09-13 12:13:01 +02:00
|
|
|
'deprecated-properties' : {},
|
2022-03-13 19:44:31 +01:00
|
|
|
'dynamictype' : {
|
|
|
|
'source' : ['dynamictype.c', 'testmodule.c'],
|
|
|
|
},
|
2018-08-15 15:45:06 +02:00
|
|
|
'enums' : {},
|
2022-10-27 13:58:53 +02:00
|
|
|
'max-version' : {'install': false},
|
2022-03-13 19:44:31 +01:00
|
|
|
'override' : {},
|
2018-08-15 15:45:06 +02:00
|
|
|
'param' : {},
|
2022-03-13 19:44:31 +01:00
|
|
|
'references' : {},
|
|
|
|
'basic-signals' : {},
|
|
|
|
'singleton' : {},
|
2018-08-15 15:45:06 +02:00
|
|
|
'threadtests' : {},
|
|
|
|
'dynamictests' : {},
|
|
|
|
'binding' : {},
|
2021-08-27 01:32:32 +02:00
|
|
|
'bindinggroup' : {},
|
2018-08-15 15:45:06 +02:00
|
|
|
'properties' : {},
|
|
|
|
'reference' : {},
|
2018-10-23 05:53:58 +02:00
|
|
|
'flags' : {},
|
2018-08-15 15:45:06 +02:00
|
|
|
'value' : {},
|
|
|
|
'type' : {},
|
|
|
|
'gobject-private' : {
|
|
|
|
'source' : 'private.c',
|
|
|
|
},
|
|
|
|
'closure' : {},
|
2019-02-27 12:48:29 +01:00
|
|
|
'closure-refcount' : { 'suite': ['slow'] },
|
2018-08-15 15:45:06 +02:00
|
|
|
'object' : {},
|
|
|
|
'signal-handler' : {},
|
|
|
|
'ifaceproperties' : {},
|
|
|
|
'signals' : {
|
|
|
|
'source' : ['signals.c', marshalers_h, marshalers_c],
|
|
|
|
},
|
2021-08-27 22:01:00 +02:00
|
|
|
'signalgroup' : {},
|
2019-07-29 14:45:21 +02:00
|
|
|
'testing' : {},
|
2021-07-26 21:10:46 +02:00
|
|
|
'type-flags' : {},
|
2022-12-16 20:48:40 +01:00
|
|
|
'objects-refcount1' : {
|
|
|
|
'c_args': cc.get_supported_arguments([
|
|
|
|
'-DG_DISABLE_CAST_CHECKS',
|
|
|
|
'-Werror',
|
|
|
|
'-Wcast-align=strict',
|
|
|
|
]),
|
|
|
|
},
|
2022-03-16 09:51:51 +01:00
|
|
|
'objects-refcount2' : {'suite' : ['slow']},
|
|
|
|
'properties-refcount1' : {},
|
|
|
|
'properties-refcount2' : {'suite' : ['slow']},
|
|
|
|
'properties-refcount3' : {'suite' : ['slow']},
|
|
|
|
'properties-refcount4' : {},
|
|
|
|
'signals-refcount1' : {
|
|
|
|
'source' : 'signals-refcount.c',
|
|
|
|
'c_args' : ['-DTESTNUM=1'],
|
|
|
|
},
|
|
|
|
'signals-refcount2' : {
|
|
|
|
'source' : 'signals-refcount.c',
|
|
|
|
'c_args' : ['-DTESTNUM=2'],
|
|
|
|
},
|
|
|
|
'signals-refcount3' : {
|
|
|
|
'source' : 'signals-refcount.c',
|
|
|
|
'c_args' : ['-DTESTNUM=3'],
|
|
|
|
},
|
|
|
|
'signals-refcount4' : {
|
|
|
|
'source' : 'signals-refcount.c',
|
|
|
|
'c_args' : ['-DTESTNUM=4'],
|
|
|
|
},
|
2018-08-15 15:45:06 +02:00
|
|
|
}
|
|
|
|
|
2022-07-15 08:23:37 +02:00
|
|
|
if have_cxx
|
|
|
|
gobject_tests += {
|
|
|
|
'cxx' : {
|
2022-12-15 22:09:17 +01:00
|
|
|
'protocol': 'exitcode',
|
2022-07-15 08:23:37 +02:00
|
|
|
'source' : ['cxx.cpp'],
|
2022-09-13 18:26:40 +02:00
|
|
|
'suite' : ['cpp'],
|
2022-07-15 08:23:37 +02:00
|
|
|
},
|
|
|
|
}
|
2022-09-13 18:26:40 +02:00
|
|
|
|
|
|
|
foreach std, arg: cxx_standards
|
|
|
|
gobject_tests += {
|
|
|
|
'cxx-@0@'.format(std) : {
|
2022-12-15 22:09:17 +01:00
|
|
|
'protocol': 'exitcode',
|
2022-09-13 18:26:40 +02:00
|
|
|
'source' : ['cxx.cpp'],
|
|
|
|
'suite' : ['cpp'],
|
|
|
|
'cpp_args' : [arg],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
endforeach
|
2022-07-15 08:23:37 +02:00
|
|
|
endif
|
|
|
|
|
2018-10-24 02:43:01 +02:00
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
gobject_tests += {'autoptr' : {}}
|
|
|
|
endif
|
|
|
|
|
2022-10-19 20:08:15 +02:00
|
|
|
python_tests = {
|
|
|
|
'genmarshal.py' : {},
|
2022-10-19 21:34:48 +02:00
|
|
|
'gobject-query.py' : {
|
2022-10-25 18:49:03 +02:00
|
|
|
'depends' : gobject_query,
|
2022-10-19 21:34:48 +02:00
|
|
|
'can_fail' : host_system == 'windows',
|
|
|
|
},
|
2022-10-19 20:08:15 +02:00
|
|
|
'mkenums.py' : {},
|
|
|
|
}
|
2019-06-07 19:03:10 +02:00
|
|
|
|
2022-10-20 02:24:04 +02:00
|
|
|
test_env = environment()
|
2018-08-15 15:45:06 +02:00
|
|
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
|
|
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
|
|
|
|
|
|
|
test_deps = [libm, thread_dep, libglib_dep, libgobject_dep]
|
2019-03-05 11:55:19 +01:00
|
|
|
test_cargs = ['-DG_LOG_DOMAIN="GLib-GObject"', '-UG_DISABLE_ASSERT']
|
2022-09-13 18:26:40 +02:00
|
|
|
test_cpp_args = test_cargs
|
2018-08-15 15:45:06 +02:00
|
|
|
|
|
|
|
foreach test_name, extra_args : gobject_tests
|
|
|
|
source = extra_args.get('source', test_name + '.c')
|
|
|
|
install = installed_tests_enabled and extra_args.get('install', true)
|
|
|
|
|
|
|
|
if install
|
|
|
|
test_conf = configuration_data()
|
|
|
|
test_conf.set('installed_tests_dir', installed_tests_execdir)
|
|
|
|
test_conf.set('program', test_name)
|
2019-02-12 12:29:10 +01:00
|
|
|
test_conf.set('env', '')
|
2018-08-15 15:45:06 +02:00
|
|
|
configure_file(
|
2018-09-23 19:44:15 +02:00
|
|
|
input: installed_tests_template_tap,
|
2018-08-15 15:45:06 +02:00
|
|
|
output: test_name + '.test',
|
|
|
|
install_dir: installed_tests_metadir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2018-08-15 15:45:06 +02:00
|
|
|
configuration: test_conf
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
exe = executable(test_name, source,
|
|
|
|
c_args : test_cargs + extra_args.get('c_args', []),
|
2022-09-13 18:26:40 +02:00
|
|
|
cpp_args : test_cpp_args + extra_args.get('cpp_args', []),
|
2018-08-15 15:45:06 +02:00
|
|
|
dependencies : test_deps + extra_args.get('dependencies', []),
|
|
|
|
install_dir: installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2018-08-15 15:45:06 +02:00
|
|
|
install: install,
|
|
|
|
)
|
|
|
|
|
|
|
|
suite = ['gobject'] + extra_args.get('suite', [])
|
2018-11-01 10:35:17 +01:00
|
|
|
timeout = suite.contains('slow') ? test_timeout_slow : test_timeout
|
2019-02-27 12:48:29 +01:00
|
|
|
|
2022-10-19 20:08:15 +02:00
|
|
|
if extra_args.get('can_fail', false)
|
|
|
|
suite += 'failing'
|
|
|
|
endif
|
|
|
|
|
2019-02-27 12:48:29 +01:00
|
|
|
# FIXME: https://gitlab.gnome.org/GNOME/glib/issues/1316
|
|
|
|
# aka https://bugs.debian.org/880883
|
2020-02-13 17:40:30 +01:00
|
|
|
if test_name == 'closure-refcount' and ['arm', 'aarch64'].contains(host_machine.cpu_family())
|
2019-02-27 12:48:29 +01:00
|
|
|
timeout = timeout * 10
|
|
|
|
endif
|
|
|
|
|
2022-12-15 21:40:35 +01:00
|
|
|
test(test_name,
|
|
|
|
exe,
|
|
|
|
protocol : extra_args.get('protocol', test_protocol),
|
|
|
|
env : test_env,
|
|
|
|
timeout : timeout,
|
|
|
|
suite : suite,
|
|
|
|
)
|
2018-08-15 15:45:06 +02:00
|
|
|
endforeach
|
2018-05-02 12:05:20 +02:00
|
|
|
|
2022-10-19 20:08:15 +02:00
|
|
|
foreach test_name, extra_args : python_tests
|
2022-10-25 18:47:40 +02:00
|
|
|
depends = [extra_args.get('depends', [])]
|
2022-10-19 20:08:15 +02:00
|
|
|
suite = ['gobject', 'no-valgrind']
|
|
|
|
|
|
|
|
if extra_args.get('can_fail', false)
|
|
|
|
suite += 'failing'
|
|
|
|
endif
|
|
|
|
|
2019-06-07 19:03:10 +02:00
|
|
|
test(
|
|
|
|
test_name,
|
|
|
|
python,
|
2022-12-15 21:40:35 +01:00
|
|
|
protocol : extra_args.get('protocol', test_protocol),
|
2022-10-25 18:47:40 +02:00
|
|
|
depends: depends,
|
2019-06-20 10:25:59 +02:00
|
|
|
args: ['-B', files(test_name)],
|
2019-06-07 19:03:10 +02:00
|
|
|
env: test_env,
|
2022-10-19 20:08:15 +02:00
|
|
|
suite: suite,
|
2019-06-07 19:03:10 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
if installed_tests_enabled
|
|
|
|
install_data(
|
|
|
|
files(test_name),
|
|
|
|
install_dir: installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2019-06-07 19:03:10 +02:00
|
|
|
install_mode: 'rwxr-xr-x',
|
|
|
|
)
|
|
|
|
|
|
|
|
test_conf = configuration_data()
|
|
|
|
test_conf.set('installed_tests_dir', installed_tests_execdir)
|
|
|
|
test_conf.set('program', test_name)
|
|
|
|
test_conf.set('env', '')
|
|
|
|
configure_file(
|
|
|
|
input: installed_tests_template_tap,
|
|
|
|
output: test_name + '.test',
|
|
|
|
install_dir: installed_tests_metadir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2019-06-07 19:03:10 +02:00
|
|
|
configuration: test_conf,
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
# TAP test runner for Python tests
|
|
|
|
if installed_tests_enabled
|
|
|
|
install_data(
|
|
|
|
files('taptestrunner.py'),
|
|
|
|
install_dir: installed_tests_execdir,
|
2022-09-20 17:00:10 +02:00
|
|
|
install_tag: 'tests',
|
2019-06-07 19:03:10 +02:00
|
|
|
)
|
|
|
|
endif
|