meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: I11f0b9ec49d8a0a7f180b379d9d28f45e6cc3799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/fault-monitor/meson.build b/fault-monitor/meson.build
index c314665..6765b7b 100644
--- a/fault-monitor/meson.build
+++ b/fault-monitor/meson.build
@@ -1,16 +1,9 @@
-fault_monitor_sources = [
- 'monitor-main.cpp',
-]
+fault_monitor_sources = ['monitor-main.cpp']
if get_option('monitor-operational-status').allowed()
- fault_monitor_sources += [
- '../utils.cpp',
- 'operational-status-monitor.cpp',
- ]
+ fault_monitor_sources += ['../utils.cpp', 'operational-status-monitor.cpp']
else
- fault_monitor_sources += [
- 'fru-fault-monitor.cpp',
- ]
+ fault_monitor_sources += ['fru-fault-monitor.cpp']
endif
executable(
@@ -19,5 +12,5 @@
include_directories: ['.', '../'],
dependencies: deps,
install: true,
- install_dir: get_option('bindir')
+ install_dir: get_option('bindir'),
)
diff --git a/manager/meson.build b/manager/meson.build
index 0c97649..ce4dbed 100644
--- a/manager/meson.build
+++ b/manager/meson.build
@@ -10,20 +10,32 @@
if get_option('use-json').disabled()
led_gen_hpp = custom_target(
'led-gen.hpp',
- command : [
+ command: [
prog_python,
meson.project_source_root() + '/scripts/parse_led.py',
- '-i', meson.project_source_root(),
- '-o', meson.current_build_dir(),
+ '-i',
+ meson.project_source_root(),
+ '-o',
+ meson.current_build_dir(),
],
- output : 'led-gen.hpp')
+ output: 'led-gen.hpp',
+ )
sources += [led_gen_hpp]
endif
if get_option('use-lamp-test').allowed()
- conf_data.set_quoted('LAMP_TEST_OBJECT', '/xyz/openbmc_project/led/groups/lamp_test')
- conf_data.set_quoted('HOST_LAMP_TEST_OBJECT', '/xyz/openbmc_project/led/groups/host_lamp_test')
- conf_data.set_quoted('LAMP_TEST_LED_OVERRIDES_JSON', '/usr/share/phosphor-led-manager/lamp-test-led-overrides.json')
+ conf_data.set_quoted(
+ 'LAMP_TEST_OBJECT',
+ '/xyz/openbmc_project/led/groups/lamp_test',
+ )
+ conf_data.set_quoted(
+ 'HOST_LAMP_TEST_OBJECT',
+ '/xyz/openbmc_project/led/groups/host_lamp_test',
+ )
+ conf_data.set_quoted(
+ 'LAMP_TEST_LED_OVERRIDES_JSON',
+ '/usr/share/phosphor-led-manager/lamp-test-led-overrides.json',
+ )
conf_data.set('LAMP_TEST_TIMEOUT_IN_SECS', 240)
sources += ['lamptest/lamptest.cpp']
@@ -35,5 +47,5 @@
include_directories: ['..'],
dependencies: deps,
install: true,
- install_dir: get_option('bindir')
+ install_dir: get_option('bindir'),
)
diff --git a/meson.build b/meson.build
index 2aaac45..ed71cc6 100644
--- a/meson.build
+++ b/meson.build
@@ -1,19 +1,23 @@
project(
- 'phosphor-ledmanager', 'cpp',
- version : '1.0.0',
+ 'phosphor-ledmanager',
+ 'cpp',
+ version: '1.0.0',
meson_version: '>=1.1.1',
default_options: [
'warning_level=3',
'werror=true',
'cpp_std=c++23',
'buildtype=debugoptimized',
- ]
+ ],
)
cpp = meson.get_compiler('cpp')
conf_data = configuration_data()
-conf_data.set_quoted('SAVED_GROUPS_FILE', '/var/lib/phosphor-led-manager/savedGroups')
+conf_data.set_quoted(
+ 'SAVED_GROUPS_FILE',
+ '/var/lib/phosphor-led-manager/savedGroups',
+)
conf_data.set_quoted('CALLOUT_FWD_ASSOCIATION', 'callout')
conf_data.set_quoted('CALLOUT_REV_ASSOCIATION', 'fault')
conf_data.set_quoted('ELOG_ENTRY', 'entry')
@@ -22,8 +26,14 @@
conf_data.set('CLASS_VERSION', 1)
conf_data.set('LED_USE_JSON', get_option('use-json').allowed())
conf_data.set('USE_LAMP_TEST', get_option('use-lamp-test').allowed())
-conf_data.set('MONITOR_OPERATIONAL_STATUS', get_option('monitor-operational-status').allowed())
-conf_data.set('PERSISTENT_LED_ASSERTED', get_option('persistent-led-asserted').allowed())
+conf_data.set(
+ 'MONITOR_OPERATIONAL_STATUS',
+ get_option('monitor-operational-status').allowed(),
+)
+conf_data.set(
+ 'PERSISTENT_LED_ASSERTED',
+ get_option('persistent-led-asserted').allowed(),
+)
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
@@ -47,14 +57,18 @@
'cereal/cereal.hpp',
'cereal::specialize',
dependencies: cereal_dep,
- required: false)
+ required: false,
+)
if not has_cereal
cereal_opts = import('cmake').subproject_options()
- cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'})
+ cereal_opts.add_cmake_defines(
+ {'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'},
+ )
cereal_proj = import('cmake').subproject(
'cereal',
options: cereal_opts,
- required: false)
+ required: false,
+ )
assert(cereal_proj.found(), 'cereal is required')
cereal_dep = cereal_proj.dependency('cereal')
endif
@@ -72,19 +86,19 @@
subdir('manager')
subdir('fault-monitor')
-configure_file(output: 'config.h',
- configuration: conf_data
-)
+configure_file(output: 'config.h', configuration: conf_data)
install_data(
'scripts/led-set-all-groups-asserted.sh',
- install_dir: get_option('bindir')
+ install_dir: get_option('bindir'),
)
if get_option('tests').allowed()
- subdir('test')
+ subdir('test')
endif
-install_subdir('configs',
+install_subdir(
+ 'configs',
install_dir: get_option('datadir') / 'phosphor-led-manager',
- strip_directory: true)
+ strip_directory: true,
+)
diff --git a/meson.options b/meson.options
index b8af61f..df054e3 100644
--- a/meson.options
+++ b/meson.options
@@ -1,29 +1,29 @@
+option('tests', type: 'feature', value: 'enabled', description: 'Build tests')
+
option(
- 'tests', type : 'feature',
+ 'use-json',
+ type: 'feature',
value: 'enabled',
- description : 'Build tests'
+ description: 'LEDs JSON filepath',
)
option(
- 'use-json', type : 'feature',
+ 'use-lamp-test',
+ type: 'feature',
value: 'enabled',
- description : 'LEDs JSON filepath'
+ description: 'LEDs lamp test configuration',
)
option(
- 'use-lamp-test', type : 'feature',
- value: 'enabled',
- description : 'LEDs lamp test configuration'
-)
-
-option(
- 'monitor-operational-status', type : 'feature',
+ 'monitor-operational-status',
+ type: 'feature',
value: 'disabled',
- description : 'Enable OperationalStatus monitor'
+ description: 'Enable OperationalStatus monitor',
)
option(
- 'persistent-led-asserted', type : 'feature',
+ 'persistent-led-asserted',
+ type: 'feature',
value: 'enabled',
- description : 'Persistent the asserted status of ledgroup'
+ description: 'Persistent the asserted status of ledgroup',
)
diff --git a/test/meson.build b/test/meson.build
index b7f0b47..cdfced7 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -8,70 +8,68 @@
dependency('threads'),
gtest_proj.dependency('gtest'),
gtest_proj.dependency('gtest_main'),
- ]
+ ],
)
gmock_dep = gtest_proj.dependency('gmock')
- else
+ else
assert(
not get_option('tests').allowed(),
- 'Googletest is required if tests are enabled'
+ 'Googletest is required if tests are enabled',
)
- endif
+ endif
endif
-test_yamls = [
- 'test-empty-group',
- 'test-group-priority',
- 'test-led-priority'
-]
+test_yamls = ['test-empty-group', 'test-group-priority', 'test-led-priority']
test_sources = [
- '../manager/manager.cpp',
- '../manager/config-validator.cpp',
- '../utils.cpp',
+ '../manager/manager.cpp',
+ '../manager/config-validator.cpp',
+ '../utils.cpp',
]
foreach yaml : test_yamls
- gen_hpp = custom_target(
- yaml + '.hpp',
- command : [
- prog_python,
- meson.project_source_root() + '/scripts/parse_led.py',
- '--filename', meson.project_source_root() + '/test/config/' + yaml + '.yaml',
- '-o', meson.current_build_dir(),
- '--output-filename', yaml + '.hpp'
- ],
- output : yaml + '.hpp')
+ gen_hpp = custom_target(
+ yaml + '.hpp',
+ command: [
+ prog_python,
+ meson.project_source_root() + '/scripts/parse_led.py',
+ '--filename',
+ meson.project_source_root() + '/test/config/' + yaml + '.yaml',
+ '-o',
+ meson.current_build_dir(),
+ '--output-filename',
+ yaml + '.hpp',
+ ],
+ output: yaml + '.hpp',
+ )
- test_sources += [ gen_hpp ]
+ test_sources += [gen_hpp]
endforeach
tests = [
- 'utest.cpp',
- 'utest-led-json.cpp',
- 'utest-group-priority.cpp',
- 'utest-led-yaml-group-priority.cpp',
- 'utest-led-yaml-led-priority.cpp',
- 'utest-led-yaml-empty-group.cpp',
- 'utest-config-validator.cpp'
+ 'utest.cpp',
+ 'utest-led-json.cpp',
+ 'utest-group-priority.cpp',
+ 'utest-led-yaml-group-priority.cpp',
+ 'utest-led-yaml-led-priority.cpp',
+ 'utest-led-yaml-empty-group.cpp',
+ 'utest-config-validator.cpp',
]
if get_option('persistent-led-asserted').allowed()
- test_sources += [
- '../manager/serialize.cpp',
- ]
- tests += [
- 'utest-serialize.cpp',
- ]
+ test_sources += ['../manager/serialize.cpp']
+ tests += ['utest-serialize.cpp']
endif
foreach t : tests
- test(t, executable(t.underscorify(), t,
- test_sources,
- include_directories: ['..', '../manager'],
- dependencies: [
- gtest_dep,
- gmock_dep,
- deps
- ]),
- workdir: meson.current_source_dir())
+ test(
+ t,
+ executable(
+ t.underscorify(),
+ t,
+ test_sources,
+ include_directories: ['..', '../manager'],
+ dependencies: [gtest_dep, gmock_dep, deps],
+ ),
+ workdir: meson.current_source_dir(),
+ )
endforeach