mirror of
https://github.com/swaywm/sway.git
synced 2026-03-10 05:34:03 -04:00
Add some tests about config
Create a test infrastructure, create few tests about the config file reading and validation. Add couple of checks in config.c to avoid null pointers exceptions when running tests.
This commit is contained in:
parent
a25645a5a6
commit
884338cff4
7 changed files with 287 additions and 24 deletions
25
meson.build
25
meson.build
|
|
@ -186,6 +186,19 @@ else
|
|||
)
|
||||
endif
|
||||
|
||||
# subdir('sway') needs reference_config_file
|
||||
# as input for its tests
|
||||
config = configuration_data()
|
||||
config.set('datadir', join_paths(prefix, datadir))
|
||||
config.set('prefix', prefix)
|
||||
config.set('sysconfdir', join_paths(prefix, sysconfdir))
|
||||
|
||||
reference_config_file = configure_file(
|
||||
configuration: config,
|
||||
input: 'config.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: join_paths(sysconfdir, 'sway')
|
||||
)
|
||||
|
||||
sway_inc = include_directories('include')
|
||||
|
||||
|
|
@ -205,18 +218,6 @@ if get_option('swaynag')
|
|||
subdir('swaynag')
|
||||
endif
|
||||
|
||||
config = configuration_data()
|
||||
config.set('datadir', join_paths(prefix, datadir))
|
||||
config.set('prefix', prefix)
|
||||
config.set('sysconfdir', join_paths(prefix, sysconfdir))
|
||||
|
||||
configure_file(
|
||||
configuration: config,
|
||||
input: 'config.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: join_paths(sysconfdir, 'sway')
|
||||
)
|
||||
|
||||
install_data(
|
||||
'sway.desktop',
|
||||
install_dir: join_paths(datadir, 'wayland-sessions')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue