2017-10-18 02:18:51 +00:00
|
|
|
testexecdir = join_paths(installed_test_bindir, 'gtk')
|
|
|
|
testdatadir = join_paths(installed_test_datadir, 'gtk')
|
|
|
|
|
2017-08-01 08:57:11 +00:00
|
|
|
gtk_tests_export_dynamic_ldflag = []
|
|
|
|
|
|
|
|
if cc.get_id() != 'msvc'
|
2020-07-18 00:57:17 +00:00
|
|
|
if os_darwin
|
|
|
|
gtk_tests_export_dynamic_ldflag = ['-Wl,-export_dynamic']
|
2022-08-18 07:44:32 +00:00
|
|
|
elif os_win32
|
|
|
|
gtk_tests_export_dynamic_ldflag = ['-Wl,--export-all-symbols']
|
2020-07-18 00:57:17 +00:00
|
|
|
else
|
|
|
|
gtk_tests_export_dynamic_ldflag = ['-Wl,--export-dynamic']
|
|
|
|
endif
|
2017-08-01 08:57:11 +00:00
|
|
|
endif
|
|
|
|
|
2020-07-10 15:32:15 +00:00
|
|
|
# Available keys for each test:
|
|
|
|
#
|
|
|
|
# - 'name': the test name; used for the test and to determine the base
|
|
|
|
# source file for the test (MANDATORY)
|
|
|
|
# - 'sources': (array): additional sources needed by the test
|
|
|
|
# - 'c_args': (array): additional compiler arguments
|
|
|
|
# - 'link_args': (array): additional linker arguments
|
|
|
|
# - 'suites': (array): additional test suites
|
2017-03-22 11:23:52 +00:00
|
|
|
tests = [
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'accel' },
|
2020-10-03 16:22:05 +00:00
|
|
|
# sadly, mesons xfail support seems busted
|
|
|
|
# { 'name': 'accessor-apis' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'action' },
|
|
|
|
{ 'name': 'adjustment' },
|
|
|
|
{ 'name': 'bitset' },
|
2022-07-17 13:10:38 +00:00
|
|
|
{ 'name': 'border' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{
|
|
|
|
'name': 'builder',
|
|
|
|
'link_args': gtk_tests_export_dynamic_ldflag,
|
|
|
|
},
|
|
|
|
{ 'name': 'builderparser' },
|
2021-05-07 11:43:19 +00:00
|
|
|
{ 'name': 'calendar' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'cellarea' },
|
|
|
|
{ 'name': 'check-icon-names' },
|
|
|
|
{ 'name': 'cssprovider' },
|
|
|
|
{ 'name': 'defaultvalue' },
|
|
|
|
{ 'name': 'entry' },
|
|
|
|
{ 'name': 'expression' },
|
2021-06-04 22:34:01 +00:00
|
|
|
{ 'name': 'filefilter' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'filter' },
|
|
|
|
{ 'name': 'filterlistmodel' },
|
|
|
|
{
|
|
|
|
'name': 'filterlistmodel-exhaustive',
|
|
|
|
'suites': ['slow'],
|
|
|
|
},
|
|
|
|
{ 'name': 'flattenlistmodel' },
|
|
|
|
{ 'name': 'floating' },
|
|
|
|
{ 'name': 'flowbox' },
|
|
|
|
#{ 'name': 'gestures' },
|
|
|
|
{ 'name': 'grid' },
|
|
|
|
{ 'name': 'grid-layout' },
|
|
|
|
{ 'name': 'icontheme' },
|
2021-03-03 03:30:11 +00:00
|
|
|
{ 'name': 'label' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'listbox' },
|
2022-07-15 02:51:13 +00:00
|
|
|
{ 'name': 'listlistmodel' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'main' },
|
|
|
|
{ 'name': 'maplistmodel' },
|
|
|
|
{ 'name': 'multiselection' },
|
2022-07-15 03:32:00 +00:00
|
|
|
{ 'name': 'noselection' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'notify' },
|
|
|
|
{ 'name': 'no-gtk-init' },
|
|
|
|
{ 'name': 'object' },
|
|
|
|
{ 'name': 'objects-finalize' },
|
|
|
|
{ 'name': 'papersize' },
|
|
|
|
#{ 'name': 'popover' },
|
|
|
|
{ 'name': 'recentmanager' },
|
|
|
|
{ 'name': 'regression-tests' },
|
|
|
|
{ 'name': 'scrolledwindow' },
|
|
|
|
{ 'name': 'searchbar' },
|
|
|
|
{ 'name': 'shortcuts' },
|
|
|
|
{ 'name': 'singleselection' },
|
|
|
|
{ 'name': 'slicelistmodel' },
|
|
|
|
{ 'name': 'sorter' },
|
|
|
|
{ 'name': 'sortlistmodel' },
|
2020-07-12 04:53:06 +00:00
|
|
|
{ 'name': 'sortlistmodel-exhaustive' },
|
2020-07-10 15:32:15 +00:00
|
|
|
{ 'name': 'spinbutton' },
|
|
|
|
{ 'name': 'stringlist' },
|
|
|
|
{ 'name': 'templates' },
|
|
|
|
{ 'name': 'textiter' },
|
|
|
|
{ 'name': 'theme-validate' },
|
|
|
|
{ 'name': 'tooltips' },
|
|
|
|
{ 'name': 'treelistmodel' },
|
|
|
|
{
|
|
|
|
'name': 'treemodel',
|
|
|
|
'sources': [
|
|
|
|
'treemodel.c',
|
|
|
|
'liststore.c',
|
|
|
|
'treestore.c',
|
|
|
|
'filtermodel.c',
|
|
|
|
'modelrefcount.c',
|
|
|
|
'sortmodel.c',
|
|
|
|
'gtktreemodelrefcount.c',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{ 'name': 'treepath' },
|
|
|
|
{ 'name': 'treesorter' },
|
|
|
|
{ 'name': 'treeview' },
|
|
|
|
{ 'name': 'typename' },
|
|
|
|
{ 'name': 'displayclose' },
|
|
|
|
{ 'name': 'revealer-size' },
|
|
|
|
{ 'name': 'widgetorder' },
|
|
|
|
{ 'name': 'widget-refcount' },
|
2017-03-22 11:23:52 +00:00
|
|
|
]
|
|
|
|
|
2021-01-23 03:50:42 +00:00
|
|
|
# Tests that test private apis and therefore are linked against libgtk-4.a
|
|
|
|
internal_tests = [
|
|
|
|
{ 'name': 'bitmask' },
|
2021-02-01 20:48:06 +00:00
|
|
|
{
|
|
|
|
'name': 'composetable',
|
|
|
|
'sources': [
|
|
|
|
'composetable.c',
|
|
|
|
'../testutils.c'
|
|
|
|
],
|
|
|
|
},
|
2021-08-03 00:42:01 +00:00
|
|
|
{ 'name': 'imcontext' },
|
2021-01-23 03:50:42 +00:00
|
|
|
{ 'name': 'constraint-solver' },
|
|
|
|
{ 'name': 'rbtree-crash' },
|
|
|
|
{ 'name': 'propertylookuplistmodel' },
|
|
|
|
{ 'name': 'rbtree' },
|
|
|
|
{ 'name': 'timsort' },
|
2022-04-26 19:01:08 +00:00
|
|
|
{ 'name': 'textbuffer' },
|
2021-05-26 11:11:47 +00:00
|
|
|
{ 'name': 'texthistory' },
|
2021-06-04 03:33:33 +00:00
|
|
|
{ 'name': 'fnmatch' },
|
2021-01-23 03:50:42 +00:00
|
|
|
]
|
|
|
|
|
2020-02-11 14:53:57 +00:00
|
|
|
# Tests that are expected to fail
|
|
|
|
xfail = [
|
2020-10-03 16:22:05 +00:00
|
|
|
# we are still missing some accessors
|
|
|
|
'accessor-apis',
|
2020-03-19 15:25:38 +00:00
|
|
|
# one of the window resizing tests fails after
|
|
|
|
# the GdkToplevel refactoring, and needs a big
|
|
|
|
# gtkwindow.c configure request cleanup
|
|
|
|
'window',
|
2020-02-11 14:53:57 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
is_debug = get_option('buildtype').startswith('debug')
|
|
|
|
|
2017-03-22 11:23:52 +00:00
|
|
|
test_cargs = []
|
|
|
|
|
2020-10-09 17:17:04 +00:00
|
|
|
test_env = environment()
|
2020-11-07 12:50:11 +00:00
|
|
|
test_env.set('GTK_A11Y', 'test')
|
2020-10-09 17:17:04 +00:00
|
|
|
test_env.set('GSK_RENDERER', 'cairo')
|
|
|
|
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
|
|
|
|
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
|
|
|
test_env.set('GIO_USE_VFS', 'local')
|
|
|
|
test_env.set('GSETTINGS_BACKEND', 'memory')
|
|
|
|
test_env.set('G_ENABLE_DIAGNOSTIC', '0')
|
|
|
|
|
2017-03-22 11:23:52 +00:00
|
|
|
if os_unix
|
|
|
|
# tests += [['defaultvalue']] # disabled in Makefile.am as well
|
|
|
|
test_cargs += ['-DHAVE_UNIX_PRINT_WIDGETS']
|
|
|
|
endif
|
|
|
|
|
2020-03-07 14:16:36 +00:00
|
|
|
foreach flag: common_cflags
|
2021-11-15 14:34:05 +00:00
|
|
|
if flag not in ['-Werror=missing-prototypes', '-Wmissing-prototypes',
|
|
|
|
'-Werror=missing-declarations', '-Wmissing-declarations',
|
|
|
|
'-fvisibility=hidden']
|
2020-03-07 14:16:36 +00:00
|
|
|
test_cargs += flag
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2017-03-22 11:23:52 +00:00
|
|
|
foreach t : tests
|
2020-07-10 15:32:15 +00:00
|
|
|
test_name = t.get('name')
|
|
|
|
test_srcs = ['@0@.c'.format(test_name)] + t.get('sources', [])
|
|
|
|
test_extra_cargs = t.get('c_args', [])
|
|
|
|
test_extra_ldflags = t.get('link_args', [])
|
|
|
|
test_extra_suites = t.get('suites', [])
|
2020-07-10 15:12:25 +00:00
|
|
|
test_timeout = 60
|
2017-03-22 11:23:52 +00:00
|
|
|
|
2020-12-15 12:31:38 +00:00
|
|
|
test_exe = executable(test_name,
|
|
|
|
sources: test_srcs,
|
|
|
|
c_args: test_cargs + test_extra_cargs,
|
|
|
|
link_args: test_extra_ldflags,
|
|
|
|
dependencies: libgtk_dep,
|
2017-10-18 02:18:51 +00:00
|
|
|
install: get_option('install-tests'),
|
2020-12-15 12:31:38 +00:00
|
|
|
install_dir: testexecdir,
|
|
|
|
)
|
2017-03-22 11:23:52 +00:00
|
|
|
|
2020-02-11 14:53:57 +00:00
|
|
|
expect_fail = xfail.contains(test_name)
|
|
|
|
|
2020-07-10 15:12:25 +00:00
|
|
|
if test_extra_suites.contains('slow')
|
|
|
|
test_timeout = 90
|
|
|
|
endif
|
|
|
|
|
2017-10-18 02:18:51 +00:00
|
|
|
test(test_name, test_exe,
|
2020-12-15 12:31:38 +00:00
|
|
|
args: [ '--tap', '-k' ],
|
|
|
|
protocol: 'tap',
|
|
|
|
timeout: test_timeout,
|
|
|
|
env: test_env,
|
|
|
|
suite: ['gtk'] + test_extra_suites,
|
|
|
|
should_fail: expect_fail,
|
2020-02-11 14:53:57 +00:00
|
|
|
)
|
2017-03-22 11:23:52 +00:00
|
|
|
endforeach
|
|
|
|
|
2021-01-23 03:50:42 +00:00
|
|
|
foreach t : internal_tests
|
|
|
|
test_name = t.get('name')
|
|
|
|
test_srcs = ['@0@.c'.format(test_name)] + t.get('sources', [])
|
|
|
|
test_extra_cargs = t.get('c_args', [])
|
|
|
|
test_extra_ldflags = t.get('link_args', [])
|
|
|
|
test_extra_suites = t.get('suites', [])
|
|
|
|
test_timeout = 60
|
|
|
|
|
|
|
|
test_exe = executable(test_name,
|
|
|
|
sources: test_srcs,
|
|
|
|
c_args: test_cargs + test_extra_cargs,
|
|
|
|
link_args: test_extra_ldflags,
|
|
|
|
dependencies: libgtk_static_dep,
|
|
|
|
install: get_option('install-tests'),
|
|
|
|
install_dir: testexecdir,
|
|
|
|
)
|
|
|
|
|
|
|
|
expect_fail = xfail.contains(test_name)
|
|
|
|
|
|
|
|
if test_extra_suites.contains('slow')
|
|
|
|
test_timeout = 90
|
|
|
|
endif
|
|
|
|
|
|
|
|
test(test_name, test_exe,
|
|
|
|
args: [ '--tap', '-k' ],
|
|
|
|
protocol: 'tap',
|
|
|
|
timeout: test_timeout,
|
|
|
|
env: test_env,
|
|
|
|
suite: ['gtk'] + test_extra_suites,
|
|
|
|
should_fail: expect_fail,
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
2017-03-22 11:23:52 +00:00
|
|
|
# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++
|
2020-12-15 12:31:38 +00:00
|
|
|
if add_languages('cpp', required: false, native: false)
|
2017-03-22 11:23:52 +00:00
|
|
|
test_exe = executable('autotestkeywords',
|
2020-12-15 12:31:38 +00:00
|
|
|
sources: 'autotestkeywords.cc',
|
|
|
|
dependencies: libgtk_dep,
|
|
|
|
install: get_option('install-tests'),
|
|
|
|
install_dir: testexecdir,
|
|
|
|
)
|
2017-10-18 02:18:51 +00:00
|
|
|
test('c++ keywords', test_exe,
|
2020-12-15 12:31:38 +00:00
|
|
|
args: [ '--tap', '-k' ],
|
|
|
|
#protocol: 'tap',
|
|
|
|
env: test_env,
|
|
|
|
suite: 'gtk',
|
|
|
|
)
|
2017-10-18 02:18:51 +00:00
|
|
|
if get_option('install-tests')
|
|
|
|
conf = configuration_data()
|
|
|
|
conf.set('testexecdir', testexecdir)
|
2018-09-19 07:09:18 +00:00
|
|
|
conf.set('test', 'autotestkeywords')
|
2017-10-18 02:18:51 +00:00
|
|
|
configure_file(input: 'gtk.test.in',
|
2020-12-15 12:31:38 +00:00
|
|
|
output: 'autotestkeywords.test',
|
|
|
|
configuration: conf,
|
|
|
|
install_dir: testdatadir,
|
|
|
|
)
|
2017-10-18 02:18:51 +00:00
|
|
|
endif
|
2017-03-22 11:23:52 +00:00
|
|
|
endif
|
|
|
|
|
2020-04-08 12:01:58 +00:00
|
|
|
|
2019-06-11 14:11:28 +00:00
|
|
|
focus_chain_tests = [
|
|
|
|
# test direction
|
|
|
|
[ 'basic', 'tab' ],
|
|
|
|
[ 'basic', 'tab-backward' ],
|
2019-06-11 14:53:08 +00:00
|
|
|
[ 'basic', 'left' ],
|
|
|
|
[ 'basic', 'right' ],
|
2020-04-04 05:25:31 +00:00
|
|
|
[ 'widget-factory', 'tab' ],
|
|
|
|
[ 'widget-factory', 'tab-backward' ],
|
2021-03-30 12:01:55 +00:00
|
|
|
# flaky
|
|
|
|
# [ 'widget-factory', 'up' ],
|
|
|
|
# [ 'widget-factory', 'down' ],
|
2020-04-04 05:25:31 +00:00
|
|
|
[ 'widget-factory', 'left' ],
|
2020-06-28 22:59:48 +00:00
|
|
|
# this one is flaky in ci, for unclear reasons
|
|
|
|
#[ 'widget-factory', 'right' ],
|
2020-04-04 05:25:31 +00:00
|
|
|
[ 'widget-factory2', 'tab' ],
|
|
|
|
[ 'widget-factory2', 'tab-backward' ],
|
2020-04-09 03:22:13 +00:00
|
|
|
# in ci, we don't show a color picker, so the focus chain
|
|
|
|
# for page3 is missing an expected button in the color editor
|
|
|
|
#[ 'widget-factory3', 'tab' ],
|
|
|
|
#[ 'widget-factory3', 'tab-backward' ],
|
2019-06-11 14:11:28 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
focus_chain = executable(
|
|
|
|
'test-focus-chain',
|
2021-01-22 04:57:24 +00:00
|
|
|
sources: ['test-focus-chain.c', '../testutils.c'],
|
2019-06-11 14:11:28 +00:00
|
|
|
dependencies: libgtk_dep,
|
2020-05-18 11:41:04 +00:00
|
|
|
c_args: common_cflags,
|
2019-06-11 14:11:28 +00:00
|
|
|
install: get_option('install-tests'),
|
|
|
|
install_dir: testexecdir
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach test : focus_chain_tests
|
|
|
|
test(test[0] + ' ' + test[1], focus_chain,
|
2020-12-15 12:31:38 +00:00
|
|
|
args: [
|
|
|
|
join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.ui'),
|
|
|
|
join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.' + test[1]),
|
|
|
|
],
|
|
|
|
env: test_env,
|
|
|
|
suite: [ 'gtk', 'focus' ],
|
|
|
|
)
|
2019-06-11 14:11:28 +00:00
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
2017-10-18 02:18:51 +00:00
|
|
|
if get_option('install-tests')
|
|
|
|
foreach t : tests
|
2020-08-02 01:23:34 +00:00
|
|
|
test_name = t.get('name')
|
2017-10-18 02:18:51 +00:00
|
|
|
conf = configuration_data()
|
|
|
|
conf.set('testexecdir', testexecdir)
|
|
|
|
conf.set('test', test_name)
|
|
|
|
configure_file(input: 'gtk.test.in',
|
2020-12-15 12:31:38 +00:00
|
|
|
output: '@0@.test'.format(test_name),
|
|
|
|
configuration: conf,
|
|
|
|
install_dir: testdatadir,
|
|
|
|
)
|
2017-10-18 02:18:51 +00:00
|
|
|
endforeach
|
2017-03-22 11:23:52 +00:00
|
|
|
|
2017-10-18 02:18:51 +00:00
|
|
|
install_subdir('icons', install_dir: testexecdir)
|
2020-08-02 02:30:06 +00:00
|
|
|
install_subdir('icons2', install_dir: testexecdir)
|
2017-10-18 02:18:51 +00:00
|
|
|
install_subdir('ui', install_dir: testexecdir)
|
|
|
|
endif
|
2017-03-22 11:23:52 +00:00
|
|
|
|
2020-03-20 17:47:58 +00:00
|
|
|
if false and get_option ('profiler')
|
2020-01-22 05:55:11 +00:00
|
|
|
|
2020-10-09 17:17:04 +00:00
|
|
|
performance_env = test_env
|
|
|
|
performance_env.set('GTK_THEME', 'Empty')
|
|
|
|
|
2020-01-22 05:55:11 +00:00
|
|
|
test('performance-layout', test_performance,
|
2020-12-15 12:31:38 +00:00
|
|
|
args: [
|
|
|
|
'--mark', 'size allocation',
|
|
|
|
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
|
|
|
|
],
|
|
|
|
env: performance_env,
|
|
|
|
suite: [ 'gtk' ],
|
|
|
|
)
|
2020-01-22 05:55:11 +00:00
|
|
|
|
|
|
|
test('performance-snapshot', test_performance,
|
2020-12-15 12:31:38 +00:00
|
|
|
args: [
|
|
|
|
'--mark', 'widget snapshot',
|
|
|
|
join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory'),
|
|
|
|
],
|
|
|
|
env: performance_env,
|
|
|
|
suite: [ 'gtk' ],
|
|
|
|
)
|
2020-01-22 05:55:11 +00:00
|
|
|
endif
|