Make the performance testcase more general

Reuse the performance test for layout and snapshot timings.
This commit is contained in:
Matthias Clasen 2020-01-22 00:55:11 -05:00
parent 68fd796125
commit 878f35515d
5 changed files with 33 additions and 4 deletions

View File

@ -1,10 +1,15 @@
if get_option ('profiler')
test_css_performance = executable('test-css-performance', 'test-css-performance.c',
dependencies: [profiler_dep, platform_gio_dep, libm])
test('performance', test_css_performance,
args: [ join_paths(meson.current_build_dir(), '../../../demos/widget-factory/gtk4-widget-factory') ],
test('performance-adwaita', test_performance,
args: [ '--mark', 'style', join_paths(meson.current_build_dir(), '../../../demos/widget-factory/gtk4-widget-factory') ],
env: [ 'GTK_THEME=Adwaita',
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir) ],
suite: [ 'css' ])
test('performance-empty', test_performance,
args: [ '--mark', 'style', join_paths(meson.current_build_dir(), '../../../demos/widget-factory/gtk4-widget-factory') ],
env: [ 'GTK_THEME=Empty',
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir) ],
suite: [ 'css' ])
endif

View File

@ -186,3 +186,22 @@ if get_option('install-tests')
endif
if get_option ('profiler')
test('performance-layout', test_performance,
args: [ '--mark', 'layout', join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
env: [ 'GTK_THEME=Empty',
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir) ],
suite: [ 'css' ])
endif
if get_option ('profiler')
test('performance-snapshot', test_performance,
args: [ '--mark', 'snapshot', join_paths(meson.current_build_dir(), '../../demos/widget-factory/gtk4-widget-factory') ],
env: [ 'GTK_THEME=Empty',
'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir) ],
suite: [ 'css' ])
endif

View File

@ -6,6 +6,7 @@ installed_test_datadir = join_paths(gtk_datadir, 'installed-tests', 'gtk-4.0')
# otherwise we're going to have failures down the line
diff = find_program('diff', required: true)
subdir('performance')
subdir('gdk')
subdir('gsk')
subdir('gtk')

View File

@ -0,0 +1,4 @@
if get_option ('profiler')
test_performance = executable('test-performance', 'test-performance.c',
dependencies: [profiler_dep, platform_gio_dep, libm])
endif