Skip to content

Commit

Permalink
meson: find all programs required for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Dec 31, 2024
1 parent 2bbb618 commit 50c2f54
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 28 deletions.
6 changes: 0 additions & 6 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ desktop_entry_final = i18n.merge_file(
install_dir: applications_dir,
)

desktop_file_validate_tool = find_program(
'desktop-file-validate',
required: false,
disabler: true,
)

test(
desktop_entry_final.full_path(),
desktop_file_validate_tool,
Expand Down
2 changes: 0 additions & 2 deletions ddterm/pref/ui/gtk4/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

gtk4_builder_tool = find_program('gtk4-builder-tool')

subdir('fixup')
subdir('3to4')

Expand Down
36 changes: 25 additions & 11 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ schema_dir = datadir / 'glib-2.0' / 'schemas'
applications_dir = datadir / 'applications'
dbus_service_dir = datadir / 'dbus-1' / 'services'

gtk3_builder_tool = find_program('gtk-builder-tool')
gtk4_builder_tool = find_program('gtk4-builder-tool')
glib_compile_schemas_tool = find_program('glib-compile-schemas')
xsltproc = find_program('xsltproc')

xgettext = find_program('xgettext', required: false, disabler: true)
desktop_file_validate_tool = find_program(
'desktop-file-validate',
required: false,
disabler: true,
)

gapplication_tool = find_program('gapplication', required: false, disabler: true)
gsettings = find_program('gsettings', required: false, disabler: true)
extensions_tool = find_program(
'gnome-extensions',
required: false,
disabler: true,
)

gnome_shell = find_program('gnome-shell', required: false, disabler: true)
dbus_daemon = find_program('dbus-daemon', required: false, disabler: true)
xvfb = find_program('Xvfb', required: false, disabler: true)
xephyr = find_program('Xephyr', required: false, disabler: true)

pack = [
fs.copyfile('stylesheet.css', install: true, install_dir: extension_dir),
files('LICENSES' / 'GPL-3.0-or-later.txt'),
Expand Down Expand Up @@ -120,9 +145,6 @@ pack += fs.copyfile(
install_dir: extension_dir,
)

gtk3_builder_tool = find_program('gtk-builder-tool')
xsltproc = find_program('xsltproc')

subdir('bin')
subdir('data')
subdir('schemas')
Expand All @@ -142,12 +164,6 @@ alias_target('pack', pack_target)

meson.add_devenv({'DDTERM_BUILT_PACK': pack_target.full_path()})

extensions_tool = find_program(
'gnome-extensions',
required: false,
disabler: true,
)

run_target(
'user-install',
command: [extensions_tool, 'install', '-f', pack_target],
Expand All @@ -159,8 +175,6 @@ foreach target : ['prefs', 'enable', 'disable', 'reset']
run_target(target, command: [extensions_tool, target, uuid])
endforeach

gapplication_tool = find_program('gapplication', required: false, disabler: true)

foreach target : ['toggle', 'quit']
run_target(
target,
Expand Down
2 changes: 0 additions & 2 deletions po/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ run_target(
],
)

xgettext = find_program('xgettext', disabler: true, required: false)

run_target(
'potfiles',
command: [
Expand Down
2 changes: 0 additions & 2 deletions schemas/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

schema = files(f'@settings_schema@.gschema.xml')

glib_compile_schemas_tool = find_program('glib-compile-schemas')

schemas_compiled = custom_target(
command: [
glib_compile_schemas_tool,
Expand Down
5 changes: 5 additions & 0 deletions test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ foreach item : pytest_tests
'-p',
'no:cacheprovider',
'--package=' + pack_target.full_path(),
'--gjs=' + gjs.full_path(),
'--gnome-extensions-tool=' + extensions_tool.full_path(),
'--gnome-shell=' + gnome_shell.full_path(),
'--xvfb=' + xvfb.full_path(),
'--gsettings-tool=' + gsettings.full_path(),
'test' / item,
],
workdir: toxinidir,
Expand Down
9 changes: 4 additions & 5 deletions tools/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ make_zip_command = [

# https://github.com/mesonbuild/meson/issues/11255
check_pack_tool = find_program(files('check_pack.py'))

run_gnome_shell_script = find_program(files('run_nested_shell.py'))

run_gnome_shell_script_common_args = [
'--gnome-shell',
find_program('gnome-shell', required: false, disabler: true),
gnome_shell,
'--dbus-daemon',
find_program('dbus-daemon', required: false, disabler: true),
dbus_daemon,
'--gnome-extensions',
find_program('gnome-extensions', required: false, disabler: true),
extensions_tool,
'--pack',
]

Expand All @@ -54,6 +53,6 @@ run_gnome_shell_xephyr_x11_command = [
run_gnome_shell_script,
'xephyr',
'--xephyr',
find_program('Xephyr', required: false, disabler: true),
xephyr,
run_gnome_shell_script_common_args,
]

0 comments on commit 50c2f54

Please sign in to comment.