build: Make installation of tests optional

Default to installing them, while letting people/distributors decide
what they want.
This commit is contained in:
Luciano Santos 2023-08-04 22:21:20 -03:00 committed by Kate Hsuan
parent 84aab7aefa
commit 5bf9cac60d
2 changed files with 22 additions and 15 deletions

View file

@ -44,3 +44,7 @@ option('zshcompletiondir',
type: 'string',
value: '',
description: 'Directory for zsh completion scripts ["no" disables]')
option('installed_tests',
type : 'boolean',
value : true,
description : 'Install integration tests')

View file

@ -148,20 +148,23 @@ if os_backend == 'linux' and gobject_introspection.found()
)
endforeach
install_data( [
'linux/integration-test.py',
'linux/output_checker.py',
],
install_dir: get_option('prefix') / get_option('libexecdir') / 'upower'
)
install_subdir('linux/tests/',
install_dir: get_option('prefix') / get_option('libexecdir') / 'upower'
)
installed_tests = get_option('installed_tests')
if installed_tests
install_data( [
'linux/integration-test.py',
'linux/output_checker.py',
],
install_dir: get_option('prefix') / get_option('libexecdir') / 'upower'
)
install_subdir('linux/tests/',
install_dir: get_option('prefix') / get_option('libexecdir') / 'upower'
)
configure_file(
input: 'upower-integration.test.in',
output: 'upower-integration.test',
install_dir: get_option('datadir') / 'installed-tests' / 'upower',
configuration: cdata
)
configure_file(
input: 'upower-integration.test.in',
output: 'upower-integration.test',
install_dir: get_option('datadir') / 'installed-tests' / 'upower',
configuration: cdata
)
endif
endif