tests/perf: Use custom solid background in tests

They don't measure performance, and we don't want to have to install
gnome-backgrounds, so bundle a solid color background image to use
instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
This commit is contained in:
Jonas Ådahl 2022-09-03 00:15:51 +02:00
parent bcc4d15fdf
commit f4934c0421
3 changed files with 5 additions and 1 deletions

View File

@ -36,6 +36,7 @@ def start_shell(perf_output=None):
env['SHELL_PERF_OUTPUT'] = perf_output
# A fixed background image
if os.getenv('SHELL_BACKGROUND_IMAGE') is None:
env['SHELL_BACKGROUND_IMAGE'] = '@pkgdatadir@/perf-background.xml'
self_dir = os.path.dirname(os.path.abspath(sys.argv[0]))

BIN
tests/data/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -46,11 +46,14 @@ perf_tests = [
gvc_typelib_path = fs.parent(libgvc.get_variable('libgvc_gir')[1].full_path())
libgvc_path = fs.parent(libgvc.get_variable('libgvc').full_path())
background_file = files(join_paths('data', 'background.png'))
perf_testenv = testenv
perf_testenv.set('G_DEBUG', 'fatal-criticals')
perf_testenv.set('G_MESSAGES_DEBUG', 'GNOME Shell')
perf_testenv.set('GNOME_SHELL_DATADIR', data_builddir)
perf_testenv.set('GNOME_SHELL_BUILDDIR', src_builddir)
perf_testenv.set('SHELL_BACKGROUND_IMAGE', '@0@'.format(background_file))
perf_testenv.append('GI_TYPELIB_PATH', gvc_typelib_path, separator: ':')
perf_testenv.append('LD_LIBRARY_PATH', libgvc_path, separator: ':')