build: Drop the install-tests option

We no longer use installed tests in CI,
so lets reap the benefit and simplify
our build setup for tests.
This commit is contained in:
Matthias Clasen
2022-12-19 23:11:20 -05:00
parent b56224fc16
commit 3121f88265
13 changed files with 44 additions and 354 deletions

View File

@@ -294,7 +294,7 @@ is mainly useful for shortening turnaround times on developer
systems. Installed builds of GTK should always have introspection systems. Installed builds of GTK should always have introspection
support. support.
### `build-tests`, `install-tests`, `demos` ### `build-tests`, `demos`
By default, GTK will build quite a few tests and demos. By default, GTK will build quite a few tests and demos.
While these are useful on a developer system, they are not While these are useful on a developer system, they are not

View File

@@ -885,7 +885,6 @@ summary('Introspection', build_gir, section: 'Build')
summary('Documentation', get_option('gtk_doc'), section: 'Build') summary('Documentation', get_option('gtk_doc'), section: 'Build')
summary('Man pages', get_option('man-pages'), section: 'Build') summary('Man pages', get_option('man-pages'), section: 'Build')
summary('Tests', get_option('build-tests'), section: 'Build') summary('Tests', get_option('build-tests'), section: 'Build')
summary('Install tests', get_option('install-tests'), section: 'Build')
summary('Demos', get_option('demos'), section: 'Build') summary('Demos', get_option('demos'), section: 'Build')
summary('Examples', get_option('build-examples'), section: 'Build') summary('Examples', get_option('build-examples'), section: 'Build')

View File

@@ -123,8 +123,3 @@ option('build-tests',
type: 'boolean', type: 'boolean',
value: true, value: true,
description : 'Build tests') description : 'Build tests')
option('install-tests',
type: 'boolean',
value: false,
description : 'Install tests')

View File

@@ -1,6 +1,3 @@
testexecdir = join_paths(installed_test_bindir, 'gtk')
testdatadir = join_paths(installed_test_datadir, 'gtk')
# Available keys for each test: # Available keys for each test:
# #
# - 'name': the test name; used for the test and to determine the base # - 'name': the test name; used for the test and to determine the base
@@ -64,12 +61,11 @@ foreach t : tests
test_extra_suites = t.get('suites', []) test_extra_suites = t.get('suites', [])
test_timeout = 60 test_timeout = 60
test_exe = executable(test_name, test_srcs, test_exe = executable(test_name,
sources: test_srcs,
c_args: test_cargs + test_extra_cargs, c_args: test_cargs + test_extra_cargs,
link_args: test_extra_ldflags, link_args: test_extra_ldflags,
dependencies: libgtk_dep, dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
if test_extra_suites.contains('slow') if test_extra_suites.contains('slow')

View File

@@ -7,17 +7,10 @@ changetest_env.set('GIO_USE_VFS', 'local')
changetest_env.set('GSETTINGS_BACKEND', 'memory') changetest_env.set('GSETTINGS_BACKEND', 'memory')
changetest_env.set('G_ENABLE_DIAGNOSTIC', '0') changetest_env.set('G_ENABLE_DIAGNOSTIC', '0')
testexecdir = join_paths(installed_test_bindir, 'css', 'change') test_change = executable('test-css-change',
testdatadir = join_paths(installed_test_datadir, 'css') sources: ['test-css-change.c', '../../testutils.c'],
test_change = executable(
'test-css-change',
'test-css-change.c',
'../../testutils.c',
c_args: common_cflags, c_args: common_cflags,
dependencies: libgtk_dep, dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test('change', test_change, test('change', test_change,
@@ -26,22 +19,3 @@ test('change', test_change,
env: changetest_env, env: changetest_env,
suite: 'css', suite: 'css',
) )
test_data = [
'test1.css', 'test1.ui', 'test1.nodes',
'test2.css', 'test2.ui', 'test2.nodes',
'test3.css', 'test3.ui', 'test3.nodes',
'test4.css', 'test4.ui', 'test4.nodes',
]
if get_option('install-tests')
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'change.test.in',
output: 'change.test',
configuration: conf,
install_dir: testdatadir)
install_data(test_data, install_dir: testexecdir)
endif

View File

@@ -13,14 +13,10 @@ subdir('nodes')
subdir('style') subdir('style')
subdir('change') subdir('change')
testexecdir = join_paths(installed_test_bindir, 'css') test_api = executable('api',
testdatadir = join_paths(installed_test_datadir, 'css') sources: ['api.c'],
test_api = executable('api', 'api.c',
c_args: common_cflags, c_args: common_cflags,
dependencies: libgtk_dep, dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test('api', test_api, test('api', test_api,
@@ -30,12 +26,11 @@ test('api', test_api,
suite: 'css', suite: 'css',
) )
test_data = executable('data', 'data.c', test_data = executable('data',
sources: ['data.c'],
c_args: common_cflags, c_args: common_cflags,
include_directories: [confinc, ], include_directories: [confinc, ],
dependencies: libgtk_static_dep, dependencies: libgtk_static_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test('data', test_data, test('data', test_data,
@@ -45,11 +40,10 @@ test('data', test_data,
suite: 'css', suite: 'css',
) )
transition = executable('transition', 'transition.c', transition = executable('transition',
sources: ['transition.c'],
c_args: common_cflags, c_args: common_cflags,
dependencies: libgtk_static_dep, dependencies: libgtk_static_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test('transition', transition, test('transition', transition,
@@ -59,24 +53,6 @@ test('transition', transition,
suite: 'css' suite: 'css'
) )
if get_option('install-tests')
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'api.test.in',
output: 'api.test',
configuration: conf,
install_dir: testdatadir,
)
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'data.test.in',
output: 'data.test',
configuration: conf,
install_dir: testdatadir,
)
endif
if false and get_option ('profiler') if false and get_option ('profiler')
adwaita_env = csstest_env adwaita_env = csstest_env

View File

@@ -7,81 +7,15 @@ nodetest_env.set('GIO_USE_VFS', 'local')
nodetest_env.set('GSETTINGS_BACKEND', 'memory') nodetest_env.set('GSETTINGS_BACKEND', 'memory')
nodetest_env.set('G_ENABLE_DIAGNOSTIC', '0') nodetest_env.set('G_ENABLE_DIAGNOSTIC', '0')
testexecdir = join_paths(installed_test_bindir, 'css', 'nodes') test_nodes = executable('test-css-nodes',
testdatadir = join_paths(installed_test_datadir, 'css') sources: ['test-css-nodes.c', '../../testutils.c'],
c_args: common_cflags,
dependencies: libgtk_dep,
)
test_nodes = executable('test-css-nodes', 'test-css-nodes.c', '../../testutils.c',
c_args: common_cflags,
install: get_option('install-tests'),
install_dir: testexecdir,
dependencies: libgtk_dep)
test('nodes', test_nodes, test('nodes', test_nodes,
args: [ '--tap', '-k' ], args: [ '--tap', '-k' ],
protocol: 'tap', protocol: 'tap',
env: nodetest_env, env: nodetest_env,
suite: 'css', suite: 'css',
) )
test_data = [
'box.ltr.nodes',
'box.ltr.ui',
'box.rtl.nodes',
'box.rtl.ui',
'buttons.nodes',
'buttons.ui',
'checkbutton.ltr.nodes',
'checkbutton.ltr.ui',
'checkbutton.rtl.nodes',
'checkbutton.rtl.ui',
'combobox.nodes',
'combobox.ui',
'entries.nodes',
'entries.ui',
'expander.ltr.nodes',
'expander.ltr.ui',
'expander.rtl.nodes',
'expander.rtl.ui',
'levelbar.ltr.nodes',
'levelbar.ltr.ui',
'levelbar.rtl.nodes',
'levelbar.rtl.ui',
'notebook-arrows2.nodes',
'notebook-arrows2.ui',
'notebook-arrows.nodes',
'notebook-arrows.ui',
'notebook.bottom.ltr.nodes',
'notebook.bottom.ltr.ui',
'notebook.bottom.rtl.nodes',
'notebook.bottom.rtl.ui',
'notebook.left.ltr.nodes',
'notebook.left.ltr.ui',
'notebook.left.rtl.nodes',
'notebook.left.rtl.ui',
'notebook.right.ltr.nodes',
'notebook.right.ltr.ui',
'notebook.right.rtl.nodes',
'notebook.right.rtl.ui',
'notebook.top.ltr.nodes',
'notebook.top.ltr.ui',
'notebook.top.rtl.nodes',
'notebook.top.rtl.ui',
'paned.ltr.nodes',
'paned.ltr.ui',
'paned.rtl.nodes',
'paned.rtl.ui',
'progressbar.nodes',
'progressbar.ui',
'scale.nodes',
'scale.ui',
]
if get_option('install-tests')
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'nodes.test.in',
output: 'nodes.test',
configuration: conf,
install_dir: testdatadir)
install_data(test_data, install_dir: testexecdir)
endif

View File

@@ -1,11 +1,8 @@
testexecdir = join_paths(installed_test_bindir, 'css', 'parser') test_parser = executable('test-css-parser',
testdatadir = join_paths(installed_test_datadir, 'css') sources: ['test-css-parser.c', '../../testutils.c'],
c_args: common_cflags,
test_parser = executable('test-css-parser', 'test-css-parser.c', '../../testutils.c', dependencies: libgtk_dep,
c_args: common_cflags, )
install: get_option('install-tests'),
install_dir: testexecdir,
dependencies: libgtk_dep)
test_data = [ test_data = [
'animation-crash-3.12.css', 'animation-crash-3.12.css',
@@ -537,15 +534,3 @@ foreach testname : test_data
suite: 'css') suite: 'css')
endif endif
endforeach endforeach
if get_option('install-tests')
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'parser.test.in',
output: 'parser.test',
configuration: conf,
install_dir: testdatadir)
install_data(test_data, install_dir: testexecdir)
endif

View File

@@ -7,73 +7,21 @@ styletest_env.set('GIO_USE_VFS', 'local')
styletest_env.set('GSETTINGS_BACKEND', 'memory') styletest_env.set('GSETTINGS_BACKEND', 'memory')
styletest_env.set('G_ENABLE_DIAGNOSTIC', '0') styletest_env.set('G_ENABLE_DIAGNOSTIC', '0')
testexecdir = join_paths(installed_test_bindir, 'css', 'style')
testdatadir = join_paths(installed_test_datadir, 'css')
cssresources = gnome.compile_resources( cssresources = gnome.compile_resources(
'cssresources', 'cssresources',
'test-css-style.gresource.xml', 'test-css-style.gresource.xml',
source_dir: '.', source_dir: '.',
) )
test_style = executable( test_style = executable('test-css-style',
'test-css-style', sources: ['test-css-style.c', '../../testutils.c', cssresources],
'test-css-style.c',
'../../testutils.c',
cssresources,
c_args: common_cflags, c_args: common_cflags,
dependencies: libgtk_dep, dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test('style', test_style, test('style', test_style,
args: [ '--tap', '-k' ], args: [ '--tap', '-k' ],
protocol: 'tap', protocol: 'tap',
env: styletest_env, env: styletest_env,
suite: 'css', suite: 'css',
) )
test_data = [
'adjacent-states.css',
'adjacent-states.nodes',
'adjacent-states.ui',
'bloomfilter-not.css',
'bloomfilter-not.nodes',
'bloomfilter-not.ui',
'colornames.css',
'colornames.nodes',
'colornames.ui',
'currentcolor.css',
'currentcolor.nodes',
'currentcolor.ui',
'font.css',
'font.nodes',
'font.ui',
'gradient.css',
'gradient.nodes',
'gradient.ui',
'gtk.css',
'inherit.css',
'inherit.nodes',
'inherit.ui',
'label.css',
'label.nodes',
'label.ui',
'misc.css',
'misc.nodes',
'misc.ui',
'nth-child.css',
'nth-child.nodes',
'nth-child.ui',
]
if get_option('install-tests')
conf = configuration_data()
conf.set('libexecdir', gtk_libexecdir)
configure_file(input: 'style.test.in',
output: 'style.test',
configuration: conf,
install_dir: testdatadir)
install_data(test_data, install_dir: testexecdir)
endif

View File

@@ -1,13 +1,10 @@
testexecdir = join_paths(installed_test_bindir, 'gdk')
testdatadir = join_paths(installed_test_datadir, 'gdk')
clipboard_client = executable('clipboard-client', clipboard_client = executable('clipboard-client',
sources: ['clipboard-client.c'], sources: ['clipboard-client.c'],
include_directories: [confinc], include_directories: [confinc],
c_args: common_cflags, c_args: common_cflags,
dependencies: [ libgtk_dep ], dependencies: [ libgtk_dep ],
install: get_option('install-tests'), install: false,
install_dir: testexecdir) )
tests = [ tests = [
{ 'name': 'array' }, { 'name': 'array' },
@@ -35,8 +32,7 @@ foreach t : tests
sources: '@0@.c'.format(test_name), sources: '@0@.c'.format(test_name),
c_args: common_cflags, c_args: common_cflags,
dependencies: libgtk_dep, dependencies: libgtk_dep,
install: get_option('install-tests'), install: false,
install_dir: testexecdir,
) )
suites = ['gdk'] + t.get('suites', []) suites = ['gdk'] + t.get('suites', [])
@@ -63,8 +59,7 @@ foreach t : internal_tests
test_exe = executable(t, '@0@.c'.format(t), test_exe = executable(t, '@0@.c'.format(t),
c_args: common_cflags, c_args: common_cflags,
dependencies: libgtk_static_dep, dependencies: libgtk_static_dep,
install: get_option('install-tests'), install: false,
install_dir: testexecdir,
) )
test(t, test_exe, test(t, test_exe,
@@ -78,28 +73,3 @@ foreach t : internal_tests
suite: 'gdk', suite: 'gdk',
) )
endforeach endforeach
if get_option('install-tests')
foreach t : tests
test_name = t.get('name')
suites = t.get('suites', [])
if suites.contains('flaky') or suites.contains('failing')
continue
endif
test_cdata = configuration_data()
test_cdata.set('testexecdir', testexecdir)
test_cdata.set('test', test_name)
configure_file(input: 'gdk.test.in',
output: '@0@.test'.format(test_name),
configuration: test_cdata,
install: true,
install_dir: testdatadir,
)
endforeach
install_subdir('clipboard-data', install_dir: testexecdir)
install_subdir('image-data', install_dir: testexecdir)
endif

View File

@@ -1,22 +1,12 @@
testexecdir = join_paths(installed_test_bindir, 'gsk') compare_render = executable('compare-render',
testdatadir = join_paths(installed_test_datadir, 'gsk')
compare_render = executable(
'compare-render',
['compare-render.c', '../reftests/reftest-compare.c'], ['compare-render.c', '../reftests/reftest-compare.c'],
dependencies: libgtk_dep, dependencies: libgtk_dep,
c_args: common_cflags, c_args: common_cflags,
install: get_option('install-tests'),
install_dir: testexecdir
) )
node_parser = executable( node_parser = executable('node-parser', 'node-parser.c',
'node-parser',
['node-parser.c'],
dependencies: libgtk_dep, dependencies: libgtk_dep,
c_args: common_cflags, c_args: common_cflags,
install: get_option('install-tests'),
install_dir: testexecdir
) )
compare_render_tests = [ compare_render_tests = [
@@ -266,11 +256,9 @@ foreach t : tests
test_extra_ldflags = t.get(3, []) test_extra_ldflags = t.get(3, [])
test_exe = executable(test_name, test_srcs, test_exe = executable(test_name, test_srcs,
dependencies : libgtk_dep,
c_args : test_cargs + test_extra_cargs + common_cflags, c_args : test_cargs + test_extra_cargs + common_cflags,
link_args : test_extra_ldflags, link_args : test_extra_ldflags,
dependencies : libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test(test_name, test_exe, test(test_name, test_exe,
@@ -299,12 +287,11 @@ foreach t : internal_tests
test_extra_cargs = t.get(2, []) test_extra_cargs = t.get(2, [])
test_extra_ldflags = t.get(3, []) test_extra_ldflags = t.get(3, [])
test_exe = executable(test_name, test_srcs, test_exe = executable(test_name,
sources: test_srcs,
dependencies : libgtk_static_dep,
c_args : test_cargs + test_extra_cargs + common_cflags, c_args : test_cargs + test_extra_cargs + common_cflags,
link_args : test_extra_ldflags, link_args : test_extra_ldflags,
dependencies : libgtk_static_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test(test_name, test_exe, test(test_name, test_exe,

View File

@@ -1,6 +1,3 @@
testexecdir = join_paths(installed_test_bindir, 'gtk')
testdatadir = join_paths(installed_test_datadir, 'gtk')
gtk_tests_export_dynamic_ldflag = [] gtk_tests_export_dynamic_ldflag = []
if cc.get_id() != 'msvc' if cc.get_id() != 'msvc'
@@ -172,8 +169,6 @@ foreach t : tests
c_args: test_cargs + test_extra_cargs, c_args: test_cargs + test_extra_cargs,
link_args: test_extra_ldflags, link_args: test_extra_ldflags,
dependencies: libgtk_dep, dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
if test_extra_suites.contains('slow') if test_extra_suites.contains('slow')
@@ -202,8 +197,6 @@ foreach t : internal_tests
c_args: test_cargs + test_extra_cargs, c_args: test_cargs + test_extra_cargs,
link_args: test_extra_ldflags, link_args: test_extra_ldflags,
dependencies: libgtk_static_dep, dependencies: libgtk_static_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
if test_extra_suites.contains('slow') if test_extra_suites.contains('slow')
@@ -222,10 +215,8 @@ endforeach
# FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++ # FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++
if add_languages('cpp', required: false, native: false) if add_languages('cpp', required: false, native: false)
test_exe = executable('autotestkeywords', test_exe = executable('autotestkeywords',
sources: 'autotestkeywords.cc', sources: ['autotestkeywords.cc'],
dependencies: libgtk_dep, dependencies: libgtk_dep,
install: get_option('install-tests'),
install_dir: testexecdir,
) )
test('c++ keywords', test_exe, test('c++ keywords', test_exe,
args: [ '--tap', '-k' ], args: [ '--tap', '-k' ],
@@ -233,16 +224,6 @@ if add_languages('cpp', required: false, native: false)
env: test_env, env: test_env,
suite: 'gtk', suite: 'gtk',
) )
if get_option('install-tests')
conf = configuration_data()
conf.set('testexecdir', testexecdir)
conf.set('test', 'autotestkeywords')
configure_file(input: 'gtk.test.in',
output: 'autotestkeywords.test',
configuration: conf,
install_dir: testdatadir,
)
endif
endif endif
@@ -268,13 +249,10 @@ focus_chain_tests = [
#[ 'widget-factory3', 'tab-backward' ], #[ 'widget-factory3', 'tab-backward' ],
] ]
focus_chain = executable( focus_chain = executable('test-focus-chain',
'test-focus-chain',
sources: ['test-focus-chain.c', '../testutils.c'], sources: ['test-focus-chain.c', '../testutils.c'],
dependencies: libgtk_dep, dependencies: libgtk_dep,
c_args: common_cflags, c_args: common_cflags,
install: get_option('install-tests'),
install_dir: testexecdir
) )
foreach test : focus_chain_tests foreach test : focus_chain_tests
@@ -296,30 +274,6 @@ test('potfiles', make_pot,
workdir: meson.project_source_root(), workdir: meson.project_source_root(),
suite: ['gtk', 'translations' ]) suite: ['gtk', 'translations' ])
if get_option('install-tests')
foreach t : tests
test_name = t.get('name')
suites = t.get('suites', [])
if suites.contains('flaky') or suites.contains('failing')
continue
endif
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
install_subdir('icons', install_dir: testexecdir)
install_subdir('icons2', install_dir: testexecdir)
install_subdir('ui', install_dir: testexecdir)
endif
if false and get_option ('profiler') if false and get_option ('profiler')
performance_env = test_env performance_env = test_env

View File

@@ -1,23 +1,12 @@
testexecdir = join_paths(installed_test_bindir, 'tools')
testdatadir = join_paths(installed_test_datadir, 'tools')
bash = find_program('bash', required : false) bash = find_program('bash', required : false)
if bash.found() if bash.found()
test_env = environment() test_env = environment()
foreach t : ['simplify', 'simplify-3to4', 'validate', 'settings'] foreach t : ['simplify', 'simplify-3to4', 'validate', 'settings']
if get_option('install-tests') configure_file(output: t,
configure_file(output: t, input: '@0@.in'.format(t),
input: '@0@.in'.format(t), copy: true,
copy: true, )
install_dir: testexecdir,
)
else
configure_file(output: t,
input: '@0@.in'.format(t),
copy: true,
)
endif
test(t, bash, test(t, bash,
args: t, args: t,
workdir: meson.current_build_dir(), workdir: meson.current_build_dir(),
@@ -34,20 +23,3 @@ if bash.found()
) )
endforeach endforeach
endif endif
if get_option('install-tests')
foreach t : ['simplify', 'settings']
test_conf = configuration_data()
test_conf.set('testexecdir', testexecdir)
test_conf.set('test', t)
configure_file(output: '@0@.test'.format(t),
input: 'tools.test.in',
configuration: test_conf,
install_dir: testdatadir,
)
endforeach
install_subdir('simplify-data', install_dir: testexecdir)
install_subdir('simplify-data-3to4', install_dir: testexecdir)
install_subdir('validate-data', install_dir: testexecdir)
endif