From 878f35515d1d3eb9d6921762eceb2b8ee652db27 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 22 Jan 2020 00:55:11 -0500 Subject: [PATCH] Make the performance testcase more general Reuse the performance test for layout and snapshot timings. --- testsuite/css/performance/meson.build | 13 +++++++++---- testsuite/gtk/meson.build | 19 +++++++++++++++++++ testsuite/meson.build | 1 + testsuite/performance/meson.build | 4 ++++ .../test-performance.c} | 0 5 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 testsuite/performance/meson.build rename testsuite/{css/performance/test-css-performance.c => performance/test-performance.c} (100%) diff --git a/testsuite/css/performance/meson.build b/testsuite/css/performance/meson.build index 781b1b3658..16a8dce1ef 100644 --- a/testsuite/css/performance/meson.build +++ b/testsuite/css/performance/meson.build @@ -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 diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index 2b5db62892..416b087c12 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -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 diff --git a/testsuite/meson.build b/testsuite/meson.build index bb7c8160f4..e5c0abe398 100644 --- a/testsuite/meson.build +++ b/testsuite/meson.build @@ -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') diff --git a/testsuite/performance/meson.build b/testsuite/performance/meson.build new file mode 100644 index 0000000000..c449cbd547 --- /dev/null +++ b/testsuite/performance/meson.build @@ -0,0 +1,4 @@ +if get_option ('profiler') + test_performance = executable('test-performance', 'test-performance.c', + dependencies: [profiler_dep, platform_gio_dep, libm]) +endif diff --git a/testsuite/css/performance/test-css-performance.c b/testsuite/performance/test-performance.c similarity index 100% rename from testsuite/css/performance/test-css-performance.c rename to testsuite/performance/test-performance.c