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'
|
|
|
|
gtk_tests_export_dynamic_ldflag = ['-Wl,--export-dynamic']
|
|
|
|
endif
|
|
|
|
|
2017-03-22 11:23:52 +00:00
|
|
|
tests = [
|
|
|
|
['accel'],
|
|
|
|
['accessible'],
|
2019-06-21 03:41:25 +00:00
|
|
|
['action'],
|
2017-03-22 11:23:52 +00:00
|
|
|
['adjustment'],
|
|
|
|
['bitmask', ['../../gtk/gtkallocatedbitmask.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']],
|
2017-08-01 08:57:11 +00:00
|
|
|
['builder', [], [], gtk_tests_export_dynamic_ldflag],
|
2017-03-22 11:23:52 +00:00
|
|
|
['builderparser'],
|
|
|
|
['cellarea'],
|
|
|
|
['check-icon-names'],
|
2019-04-09 13:05:48 +00:00
|
|
|
['constraint-solver', [
|
|
|
|
'../../gtk/gtkconstraintsolver.c',
|
|
|
|
'../../gtk/gtkconstraintexpression.c',
|
|
|
|
], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']
|
|
|
|
],
|
2017-03-22 11:23:52 +00:00
|
|
|
['cssprovider'],
|
2019-01-07 04:37:32 +00:00
|
|
|
['rbtree-crash', ['../../gtk/gtkrbtree.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']],
|
2018-06-29 19:00:06 +00:00
|
|
|
['defaultvalue'],
|
2017-03-22 11:23:52 +00:00
|
|
|
['entry'],
|
2018-08-31 03:34:18 +00:00
|
|
|
['filterlistmodel'],
|
2018-09-02 22:48:28 +00:00
|
|
|
['flattenlistmodel'],
|
2017-03-22 11:23:52 +00:00
|
|
|
['floating'],
|
|
|
|
['focus'],
|
|
|
|
['gestures'],
|
|
|
|
['grid'],
|
2019-06-28 13:28:46 +00:00
|
|
|
['grid-layout'],
|
2017-03-22 11:23:52 +00:00
|
|
|
['icontheme'],
|
|
|
|
['keyhash', ['../../gtk/gtkkeyhash.c', gtkresources, '../../gtk/gtkprivate.c'], gtk_cargs],
|
|
|
|
['listbox'],
|
2018-06-08 17:03:22 +00:00
|
|
|
['main'],
|
2018-09-10 23:28:19 +00:00
|
|
|
['maplistmodel'],
|
2017-03-22 11:23:52 +00:00
|
|
|
['notify'],
|
|
|
|
['no-gtk-init'],
|
|
|
|
['object'],
|
|
|
|
['objects-finalize'],
|
|
|
|
['papersize'],
|
2019-06-21 03:41:25 +00:00
|
|
|
['popover'],
|
2018-09-10 15:01:57 +00:00
|
|
|
['propertylookuplistmodel', ['../../gtk/gtkpropertylookuplistmodel.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']],
|
2019-01-07 03:28:09 +00:00
|
|
|
['rbtree', ['../../gtk/gtktreerbtree.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']],
|
2017-03-22 11:23:52 +00:00
|
|
|
['recentmanager'],
|
|
|
|
['regression-tests'],
|
|
|
|
['scrolledwindow'],
|
2018-05-16 15:56:34 +00:00
|
|
|
['searchbar'],
|
2019-01-06 17:57:42 +00:00
|
|
|
['singleselection'],
|
2019-01-06 17:25:50 +00:00
|
|
|
['slicelistmodel'],
|
2018-09-17 01:56:41 +00:00
|
|
|
['sortlistmodel'],
|
2017-03-22 11:23:52 +00:00
|
|
|
['spinbutton'],
|
|
|
|
['templates'],
|
|
|
|
['textbuffer'],
|
|
|
|
['textiter'],
|
2019-04-18 00:18:42 +00:00
|
|
|
['theme-validate'],
|
2018-06-12 01:56:21 +00:00
|
|
|
['treelistmodel'],
|
2017-03-22 11:23:52 +00:00
|
|
|
['treemodel', ['treemodel.c', 'liststore.c', 'treestore.c', 'filtermodel.c',
|
|
|
|
'modelrefcount.c', 'sortmodel.c', 'gtktreemodelrefcount.c']],
|
|
|
|
['treepath'],
|
|
|
|
['treeview'],
|
|
|
|
['typename'],
|
|
|
|
['window'],
|
|
|
|
['displayclose'],
|
|
|
|
['revealer-size'],
|
2017-09-29 10:10:42 +00:00
|
|
|
['widgetorder'],
|
2017-03-22 11:23:52 +00:00
|
|
|
]
|
|
|
|
|
2020-02-11 14:53:57 +00:00
|
|
|
# Tests that are expected to fail
|
|
|
|
xfail = [
|
|
|
|
]
|
|
|
|
|
|
|
|
is_debug = get_option('buildtype').startswith('debug')
|
|
|
|
|
2017-03-22 11:23:52 +00:00
|
|
|
test_cargs = []
|
|
|
|
|
|
|
|
if os_unix
|
|
|
|
# tests += [['defaultvalue']] # disabled in Makefile.am as well
|
|
|
|
test_cargs += ['-DHAVE_UNIX_PRINT_WIDGETS']
|
|
|
|
endif
|
|
|
|
|
|
|
|
foreach t : tests
|
|
|
|
test_name = t.get(0)
|
|
|
|
test_srcs = ['@0@.c'.format(test_name)] + t.get(1, [])
|
|
|
|
test_extra_cargs = t.get(2, [])
|
|
|
|
test_extra_ldflags = t.get(3, [])
|
|
|
|
|
|
|
|
test_exe = executable(test_name, test_srcs,
|
|
|
|
c_args : test_cargs + test_extra_cargs,
|
|
|
|
link_args : test_extra_ldflags,
|
2017-10-18 02:18:51 +00:00
|
|
|
dependencies : libgtk_dep,
|
|
|
|
install: get_option('install-tests'),
|
|
|
|
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)
|
|
|
|
|
2017-10-18 02:18:51 +00:00
|
|
|
test(test_name, test_exe,
|
|
|
|
args: [ '--tap', '-k' ],
|
2017-10-18 08:55:02 +00:00
|
|
|
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
|
|
|
'GSETTINGS_BACKEND=memory',
|
2020-02-03 14:11:35 +00:00
|
|
|
'GDK_DEBUG=default-settings',
|
2017-10-18 08:55:02 +00:00
|
|
|
'GTK_CSD=1',
|
|
|
|
'G_ENABLE_DIAGNOSTIC=0',
|
2017-10-18 14:45:52 +00:00
|
|
|
'GSK_RENDERER=cairo',
|
2017-10-18 08:55:02 +00:00
|
|
|
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
2018-02-17 08:48:12 +00:00
|
|
|
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
|
|
|
|
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
|
2017-10-18 08:55:02 +00:00
|
|
|
],
|
2020-02-11 14:53:57 +00:00
|
|
|
suite: 'gtk',
|
|
|
|
should_fail: expect_fail,
|
|
|
|
)
|
2017-03-22 11:23:52 +00:00
|
|
|
endforeach
|
|
|
|
|
|
|
|
# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++
|
2018-08-17 21:45:11 +00:00
|
|
|
if add_languages('cpp', required: false)
|
2017-03-22 11:23:52 +00:00
|
|
|
test_exe = executable('autotestkeywords',
|
2017-10-18 02:18:51 +00:00
|
|
|
'autotestkeywords.cc',
|
|
|
|
c_args : test_cargs + ['-Idummy-headers'],
|
|
|
|
dependencies : libgtk_dep,
|
|
|
|
install: get_option('install-tests'),
|
|
|
|
install_dir: testexecdir)
|
|
|
|
test('c++ keywords', test_exe,
|
|
|
|
args: [ '--tap', '-k' ],
|
2017-10-18 08:55:02 +00:00
|
|
|
env: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
|
|
|
'GSETTINGS_BACKEND=memory',
|
2020-02-03 14:11:35 +00:00
|
|
|
'GDK_DEBUG=default-settings',
|
2017-10-18 08:55:02 +00:00
|
|
|
'GTK_CSD=1',
|
|
|
|
'G_ENABLE_DIAGNOSTIC=0',
|
|
|
|
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
2018-02-17 08:48:12 +00:00
|
|
|
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
|
|
|
|
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir),
|
2017-10-18 08:55:02 +00:00
|
|
|
],
|
2017-10-18 02:18:51 +00:00
|
|
|
suite: 'gtk')
|
|
|
|
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',
|
2018-09-19 07:09:18 +00:00
|
|
|
output: 'autotestkeywords.test',
|
2017-10-18 02:18:51 +00:00
|
|
|
configuration: conf,
|
|
|
|
install_dir: testdatadir)
|
|
|
|
endif
|
2017-03-22 11:23:52 +00:00
|
|
|
endif
|
|
|
|
|
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' ],
|
2019-06-11 17:10:16 +00:00
|
|
|
[ 'focusable-container', 'tab' ],
|
|
|
|
[ 'focusable-container', 'tab-backward' ],
|
2019-06-11 14:11:28 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
focus_chain = executable(
|
|
|
|
'test-focus-chain',
|
|
|
|
['test-focus-chain.c'],
|
|
|
|
dependencies: libgtk_dep,
|
|
|
|
install: get_option('install-tests'),
|
|
|
|
install_dir: testexecdir
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach test : focus_chain_tests
|
|
|
|
test(test[0] + ' ' + test[1], focus_chain,
|
|
|
|
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: [ 'GIO_USE_VOLUME_MONITOR=unix',
|
|
|
|
'GSETTINGS_BACKEND=memory',
|
2020-02-03 14:11:35 +00:00
|
|
|
'GDK_DEBUG=default-settings',
|
2019-06-11 14:11:28 +00:00
|
|
|
'GTK_CSD=1',
|
|
|
|
'G_ENABLE_DIAGNOSTIC=0',
|
|
|
|
'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
|
|
|
|
'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
|
|
|
|
],
|
|
|
|
suite: [ 'gtk', 'focus' ])
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
2017-10-18 02:18:51 +00:00
|
|
|
if get_option('install-tests')
|
|
|
|
foreach t : tests
|
|
|
|
test_name = t.get(0)
|
|
|
|
conf = configuration_data()
|
|
|
|
conf.set('testexecdir', testexecdir)
|
|
|
|
conf.set('test', test_name)
|
|
|
|
configure_file(input: 'gtk.test.in',
|
|
|
|
output: '@0@.test'.format(test_name),
|
|
|
|
configuration: conf,
|
|
|
|
install_dir: testdatadir)
|
|
|
|
endforeach
|
2017-03-22 11:23:52 +00:00
|
|
|
|
2017-10-18 02:18:51 +00:00
|
|
|
install_subdir('icons', install_dir: testexecdir)
|
|
|
|
install_subdir('ui', install_dir: testexecdir)
|
2017-03-22 11:23:52 +00:00
|
|
|
|
2017-10-18 02:18:51 +00:00
|
|
|
endif
|
2017-03-22 11:23:52 +00:00
|
|
|
|
2020-01-22 05:55:11 +00:00
|
|
|
if get_option ('profiler')
|
|
|
|
|
|
|
|
test('performance-layout', test_performance,
|
2020-01-24 01:21:08 +00:00
|
|
|
args: [ '--mark', 'size allocation', join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
|
2020-01-22 05:55:11 +00:00
|
|
|
env: [ 'GTK_THEME=Empty',
|
|
|
|
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir) ],
|
2020-02-11 19:09:00 +00:00
|
|
|
suite: [ 'gtk' ])
|
2020-01-22 05:55:11 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option ('profiler')
|
|
|
|
|
|
|
|
test('performance-snapshot', test_performance,
|
2020-01-24 01:21:08 +00:00
|
|
|
args: [ '--mark', 'widget snapshot', join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
|
2020-01-22 05:55:11 +00:00
|
|
|
env: [ 'GTK_THEME=Empty',
|
|
|
|
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir) ],
|
2020-02-11 19:09:00 +00:00
|
|
|
suite: [ 'gtk' ])
|
2020-01-22 05:55:11 +00:00
|
|
|
|
|
|
|
endif
|