2020-07-22 15:31:44 +00:00
|
|
|
testexecdir = join_paths(installed_test_bindir, 'gtk')
|
|
|
|
testdatadir = join_paths(installed_test_datadir, 'gtk')
|
|
|
|
|
|
|
|
# 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
|
|
|
|
tests = [
|
2020-07-27 04:22:15 +00:00
|
|
|
{ 'name': 'accessible' },
|
2020-07-27 22:08:26 +00:00
|
|
|
{ 'name': 'button' },
|
|
|
|
{ 'name': 'checkbutton' },
|
2020-07-27 22:56:06 +00:00
|
|
|
{ 'name': 'dialog' },
|
2020-07-28 20:11:45 +00:00
|
|
|
{ 'name': 'entry' },
|
2020-07-30 01:55:34 +00:00
|
|
|
{ 'name': 'expander' },
|
2020-10-20 05:12:20 +00:00
|
|
|
{ 'name': 'flowbox' },
|
2020-10-25 23:29:00 +00:00
|
|
|
{ 'name': 'general' },
|
2020-07-28 19:44:12 +00:00
|
|
|
{ 'name': 'image' },
|
2020-07-28 20:34:01 +00:00
|
|
|
{ 'name': 'label' },
|
2020-10-20 05:07:13 +00:00
|
|
|
{ 'name': 'listbox' },
|
2020-07-30 02:10:56 +00:00
|
|
|
{ 'name': 'levelbar' },
|
2020-07-28 22:23:57 +00:00
|
|
|
{ 'name': 'passwordentry' },
|
2020-07-27 23:26:22 +00:00
|
|
|
{ 'name': 'progressbar' },
|
2020-07-28 00:28:19 +00:00
|
|
|
{ 'name': 'scrollbar' },
|
2020-07-28 22:15:01 +00:00
|
|
|
{ 'name': 'searchentry' },
|
2020-07-27 23:38:51 +00:00
|
|
|
{ 'name': 'separator' },
|
2020-07-28 01:17:41 +00:00
|
|
|
{ 'name': 'spinbutton' },
|
2020-10-20 04:46:07 +00:00
|
|
|
{ 'name': 'stack' },
|
2020-07-27 23:58:08 +00:00
|
|
|
{ 'name': 'switch' },
|
2020-07-29 22:18:04 +00:00
|
|
|
{ 'name': 'textview' },
|
2020-07-27 22:56:06 +00:00
|
|
|
{ 'name': 'window' },
|
2020-07-22 15:31:44 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Tests that are expected to fail
|
|
|
|
xfail = [
|
|
|
|
]
|
|
|
|
|
|
|
|
is_debug = get_option('buildtype').startswith('debug')
|
|
|
|
|
|
|
|
test_cargs = []
|
|
|
|
|
|
|
|
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-07-22 15:31:44 +00:00
|
|
|
test_cargs += flag
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
test_env = environment()
|
2020-11-07 12:50:11 +00:00
|
|
|
test_env.set('GTK_A11Y', 'test')
|
2020-07-22 15:31:44 +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')
|
|
|
|
|
|
|
|
foreach t : 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, test_srcs,
|
|
|
|
c_args: test_cargs + test_extra_cargs,
|
|
|
|
link_args: test_extra_ldflags,
|
|
|
|
dependencies: libgtk_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,
|
2020-12-15 12:31:38 +00:00
|
|
|
args: [ '--tap', '-k' ],
|
|
|
|
protocol: 'tap',
|
|
|
|
timeout: test_timeout,
|
|
|
|
env: test_env,
|
|
|
|
suite: ['a11y'] + test_extra_suites,
|
|
|
|
should_fail: expect_fail,
|
2020-07-22 15:31:44 +00:00
|
|
|
)
|
|
|
|
endforeach
|