meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: I5893182e6f49b59f39785995afe06be116ec18ba
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/analyzer/meson.build b/analyzer/meson.build
index e3561a0..83f71a2 100644
--- a/analyzer/meson.build
+++ b/analyzer/meson.build
@@ -29,11 +29,11 @@
# Create static library.
analyzer_lib = static_library(
'analyzer_lib',
- [ analyzer_src ],
- include_directories : incdir,
- dependencies : analyzer_deps,
- cpp_args : [ package_args ],
- install : false,
+ [analyzer_src],
+ include_directories: incdir,
+ dependencies: analyzer_deps,
+ cpp_args: [package_args],
+ install: false,
)
# Install the RAS data files.
diff --git a/analyzer/ras-data/meson.build b/analyzer/ras-data/meson.build
index 587c756..cd577e0 100644
--- a/analyzer/ras-data/meson.build
+++ b/analyzer/ras-data/meson.build
@@ -2,18 +2,18 @@
# Install the RAS data files
ras_data_files = files(
- 'data/ras-data-p10-10.json',
- 'data/ras-data-p10-20.json',
'data/ras-data-explorer-11.json',
'data/ras-data-explorer-20.json',
'data/ras-data-odyssey-10.json',
+ 'data/ras-data-p10-10.json',
+ 'data/ras-data-p10-20.json',
)
-install_data( ras_data_files, install_dir: join_paths(package_dir, 'ras-data') )
+install_data(ras_data_files, install_dir: join_paths(package_dir, 'ras-data'))
# Install the RAS data schema
-ras_data_schema = files( 'schema/ras-data-schema-v02.json' )
+ras_data_schema = files('schema/ras-data-schema-v02.json')
-install_data( ras_data_schema, install_dir: join_paths(package_dir, 'schema') )
+install_data(ras_data_schema, install_dir: join_paths(package_dir, 'schema'))
diff --git a/attn/meson.build b/attn/meson.build
index a2b01d8..674e302 100644
--- a/attn/meson.build
+++ b/attn/meson.build
@@ -1,10 +1,12 @@
# async gpio monitor needs boost library
-boost_args = ['-DBOOST_ASIO_DISABLE_THREADS',
- '-DBOOST_ERROR_CODE_HEADER_ONLY',
- '-DBOOST_SYSTEM_NO_DEPRECATED']
+boost_args = [
+ '-DBOOST_ASIO_DISABLE_THREADS',
+ '-DBOOST_ERROR_CODE_HEADER_ONLY',
+ '-DBOOST_SYSTEM_NO_DEPRECATED',
+]
# dependency to link gpiod support
-libgpiod = dependency('libgpiod', version : '>=1.4.1')
+libgpiod = dependency('libgpiod', version: '>=1.4.1')
# get openpower-hw-diags build configuration
attn_conf = configuration_data()
@@ -25,8 +27,7 @@
input: 'attn_handler.service.in',
output: 'attn_handler.service',
install: true,
- install_dir:
- dependency('systemd').get_variable('systemdsystemunitdir')
+ install_dir: dependency('systemd').get_variable('systemdsystemunitdir'),
)
# install attention handler config file
@@ -35,7 +36,7 @@
input: 'attn_config.in',
output: 'attn_config',
install: true,
- install_dir: join_paths(get_option('sysconfdir'), 'default')
+ install_dir: join_paths(get_option('sysconfdir'), 'default'),
)
# Source files.
@@ -58,22 +59,17 @@
pel_src = files(
'pel/extended_user_header.cpp',
'pel/pel_minimal.cpp',
- 'pel/private_header.cpp',
'pel/primary_src.cpp',
+ 'pel/private_header.cpp',
'pel/user_header.cpp',
)
# Library dependencies.
-attn_deps = [
- libgpiod,
- libpdbg_dep,
- phosphor_logging_dep,
- sdbusplus_dep,
-]
+attn_deps = [libgpiod, libpdbg_dep, phosphor_logging_dep, sdbusplus_dep]
# conditional library dependencies
if get_option('phal').allowed()
- attn_deps += libphal_dep
+ attn_deps += libphal_dep
endif
# Create static library.
@@ -81,8 +77,8 @@
'attn_lib',
attn_src,
pel_src,
- include_directories : incdir,
- dependencies : attn_deps,
- cpp_args : [boost_args],
- install : false,
+ include_directories: incdir,
+ dependencies: attn_deps,
+ cpp_args: [boost_args],
+ install: false,
)
diff --git a/meson.build b/meson.build
index a1040b1..4f0e3c6 100644
--- a/meson.build
+++ b/meson.build
@@ -1,28 +1,32 @@
# See README.md for details.
-project('openpower-hw-diags', 'cpp',
- version: '0.1', meson_version: '>=1.1.1',
- default_options: [
- 'warning_level=3',
- 'werror=true',
- 'cpp_std=c++23',
- ])
+project(
+ 'openpower-hw-diags',
+ 'cpp',
+ version: '0.1',
+ meson_version: '>=1.1.1',
+ default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
+)
# Package directory root, which will contain required data files.
-package_dir = join_paths( get_option('prefix'),
- get_option('datadir'),
- meson.project_name() )
+package_dir = join_paths(
+ get_option('prefix'),
+ get_option('datadir'),
+ meson.project_name(),
+)
# Compiler option so that source knows the package directory.
-package_args = [ '-DPACKAGE_DIR="' + package_dir + '/"' ]
+package_args = ['-DPACKAGE_DIR="' + package_dir + '/"']
#-------------------------------------------------------------------------------
# Versioning
#-------------------------------------------------------------------------------
-buildinfo = vcs_tag(command: ['git', 'describe', '--always', '--long'],
- input: 'buildinfo.hpp.in',
- output: 'buildinfo.hpp',
- replace_string:'@BUILDINFO@',
- fallback: '0')
+buildinfo = vcs_tag(
+ command: ['git', 'describe', '--always', '--long'],
+ input: 'buildinfo.hpp.in',
+ output: 'buildinfo.hpp',
+ replace_string: '@BUILDINFO@',
+ fallback: '0',
+)
#-------------------------------------------------------------------------------
# Compiler
@@ -57,24 +61,26 @@
# Look if the libhei library has already been built and installed. If not,
# default to the subproject.
-libhei_dep = dependency('hei', fallback : ['libhei', 'libhei_dep'])
+libhei_dep = dependency('hei', fallback: ['libhei', 'libhei_dep'])
-phosphor_logging_dep = dependency('phosphor-logging',
- fallback: ['phosphor-logging', 'phosphor_logging_dep'])
+phosphor_logging_dep = dependency(
+ 'phosphor-logging',
+ fallback: ['phosphor-logging', 'phosphor_logging_dep'],
+)
-sdbusplus_dep = dependency('sdbusplus', version : '>=1.0')
+sdbusplus_dep = dependency('sdbusplus', version: '>=1.0')
dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
libpdbg_dep = dependency('pdbg')
if get_option('phal').allowed()
- libphal_dep = cmplr.find_library('phal')
+ libphal_dep = cmplr.find_library('phal')
endif
libpldm_dep = dependency('libpldm')
-pthread = declare_dependency(link_args : '-pthread')
-lrt = declare_dependency(link_args : '-lrt')
+pthread = declare_dependency(link_args: '-pthread')
+lrt = declare_dependency(link_args: '-lrt')
# JSON parser
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
@@ -94,11 +100,7 @@
subdir('attn')
subdir('util')
-hwdiags_libs = [
- analyzer_lib,
- attn_lib,
- util_lib,
-]
+hwdiags_libs = [analyzer_lib, attn_lib, util_lib]
#-------------------------------------------------------------------------------
# Build the executable
@@ -107,18 +109,27 @@
no_listener_mode = get_option('nlmode')
if not no_listener_mode.disabled()
- executable('openpower-hw-diags',
- sources : [ 'main_nl.cpp', 'cli.cpp', buildinfo, plugins_src ],
- dependencies : [ libhei_dep, nlohmann_json_dep, phosphor_logging_dep ],
- link_with : hwdiags_libs,
- install : true)
+ executable(
+ 'openpower-hw-diags',
+ sources: ['main_nl.cpp', 'cli.cpp', buildinfo, plugins_src],
+ dependencies: [libhei_dep, nlohmann_json_dep, phosphor_logging_dep],
+ link_with: hwdiags_libs,
+ install: true,
+ )
else
- executable('openpower-hw-diags',
- sources : [ 'main.cpp', 'cli.cpp', 'listener.cpp', buildinfo,
- plugins_src ],
- dependencies : [lrt, pthread, libhei_dep, nlohmann_json_dep, phosphor_logging_dep ],
- link_with : hwdiags_libs,
- install : true)
+ executable(
+ 'openpower-hw-diags',
+ sources: ['main.cpp', 'cli.cpp', 'listener.cpp', buildinfo, plugins_src],
+ dependencies: [
+ lrt,
+ pthread,
+ libhei_dep,
+ nlohmann_json_dep,
+ phosphor_logging_dep,
+ ],
+ link_with: hwdiags_libs,
+ install: true,
+ )
endif
#-------------------------------------------------------------------------------
@@ -129,61 +140,55 @@
if not build_tests.disabled()
- # IMPORTANT NOTE:
- # We cannot link the test executables to `util_lib` because:
- # - It is built without `-DTEST_TRACE` and any of the util functions that
- # use `trace.hpp` will throw a linker error because we don't have access
- # to phosphor-logging in test ... yet. This issue will go away once we
- # have converted all of our trace to use the `lg2` interfaces.
- # - Some functions related to pdbg and dbus simply cannot be built in the
- # test environment. Instead, there are alternate implementation of those
- # functions to simulate them for testing (see `test/*-sim-only.cpp`).
- # Instead we will build a `test_util_lib` that will contain the `util` files
- # that we need in test along with simulated versions of some util functions.
+ # IMPORTANT NOTE:
+ # We cannot link the test executables to `util_lib` because:
+ # - It is built without `-DTEST_TRACE` and any of the util functions that
+ # use `trace.hpp` will throw a linker error because we don't have access
+ # to phosphor-logging in test ... yet. This issue will go away once we
+ # have converted all of our trace to use the `lg2` interfaces.
+ # - Some functions related to pdbg and dbus simply cannot be built in the
+ # test environment. Instead, there are alternate implementation of those
+ # functions to simulate them for testing (see `test/*-sim-only.cpp`).
+ # Instead we will build a `test_util_lib` that will contain the `util` files
+ # that we need in test along with simulated versions of some util functions.
- # IMPORTANT NOTE:
- # When running GCOV reports, the Jenkins CI script explicitly ignores any
- # libraries and executables built in the `test/` directory. Therefore, this
- # `test_util_lib` library must be built here instead in order to get any GCOV
- # credit for the code.
+ # IMPORTANT NOTE:
+ # When running GCOV reports, the Jenkins CI script explicitly ignores any
+ # libraries and executables built in the `test/` directory. Therefore, this
+ # `test_util_lib` library must be built here instead in order to get any GCOV
+ # credit for the code.
- test_args = [
- '-DTEST_TRACE',
- package_args,
- ]
+ test_args = ['-DTEST_TRACE', package_args]
- test_util_srcs = [
- files(
- 'util/data_file.cpp',
- 'util/ffdc_file.cpp',
- 'util/pdbg.cpp',
- 'util/temporary_file.cpp',
- 'test/dbus-sim-only.cpp',
- 'test/pdbg-sim-only.cpp',
- ),
- ]
+ test_util_srcs = [
+ files(
+ 'test/dbus-sim-only.cpp',
+ 'test/pdbg-sim-only.cpp',
+ 'util/data_file.cpp',
+ 'util/ffdc_file.cpp',
+ 'util/pdbg.cpp',
+ 'util/temporary_file.cpp',
+ ),
+ ]
- test_util_deps = [
- libhei_dep,
- libpdbg_dep,
- nlohmann_json_dep,
- phosphor_logging_dep,
- valijson_dep,
- ]
+ test_util_deps = [
+ libhei_dep,
+ libpdbg_dep,
+ nlohmann_json_dep,
+ phosphor_logging_dep,
+ valijson_dep,
+ ]
- test_util_lib = static_library('test_util_lib',
- sources : test_util_srcs,
- include_directories : incdir,
- dependencies : test_util_deps,
- cpp_args : test_args,
- install : true,
- )
+ test_util_lib = static_library(
+ 'test_util_lib',
+ sources: test_util_srcs,
+ include_directories: incdir,
+ dependencies: test_util_deps,
+ cpp_args: test_args,
+ install: true,
+ )
- test_libs = [
- analyzer_lib,
- attn_lib,
- test_util_lib,
- ]
+ test_libs = [analyzer_lib, attn_lib, test_util_lib]
- subdir('test')
+ subdir('test')
endif
diff --git a/meson.options b/meson.options
index 73675e4..968d31a 100644
--- a/meson.options
+++ b/meson.options
@@ -1,9 +1,21 @@
-option('tests', type : 'feature', description : 'Build tests')
-option('nlmode', type : 'feature', description : 'no run-time control')
-option('phal', type : 'feature', value : 'disabled',
- description : '''Enable PHAL APIs for retrieving data from the POWER
- Systems device tree''')
-option('attn_config', type : 'string', value : '',
- description : '''Attention handler default configuration override''')
-option('op_dump_obj_path', type: 'string', value: '/org/openpower/dump',
- description : '''Object path requesting OpenPOWER dumps''')
+option('tests', type: 'feature', description: 'Build tests')
+option('nlmode', type: 'feature', description: 'no run-time control')
+option(
+ 'phal',
+ type: 'feature',
+ value: 'disabled',
+ description: '''Enable PHAL APIs for retrieving data from the POWER
+ Systems device tree''',
+)
+option(
+ 'attn_config',
+ type: 'string',
+ value: '',
+ description: 'Attention handler default configuration override',
+)
+option(
+ 'op_dump_obj_path',
+ type: 'string',
+ value: '/org/openpower/dump',
+ description: 'Object path requesting OpenPOWER dumps',
+)
diff --git a/test/meson.build b/test/meson.build
index 8bf7008..a3c5498 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -3,118 +3,121 @@
gmock_dep = dependency('gmock', disabler: true, required: false)
if not gtest_dep.found() or not gmock_dep.found()
cmake = import('cmake')
- gtest_proj = cmake.subproject('googletest',
- required: false)
+ gtest_proj = cmake.subproject('googletest', required: false)
if gtest_proj.found()
gtest_dep = declare_dependency(
dependencies: [
dependency('threads'),
gtest_proj.dependency('gtest'),
gtest_proj.dependency('gtest_main'),
- ]
+ ],
)
gmock_dep = gtest_proj.dependency('gmock')
else
- assert(not get_option('tests').allowed(),
- 'Googletest is required if tests are enabled')
+ assert(
+ not get_option('tests').allowed(),
+ 'Googletest is required if tests are enabled',
+ )
endif
endif
################################################################################
# Compile the test dts into a binary for pdbg.
-pdbg_test_dtb = custom_target('build_pdbg_test_dtb',
- input : files('pdbg-test.dts'),
- output : 'pdbg-test.dtb',
- command : [ find_program('dtc'), '-I', 'dts', '-O', 'dtb',
- '-o', '@OUTPUT@', '@INPUT@' ])
+pdbg_test_dtb = custom_target(
+ 'build_pdbg_test_dtb',
+ input: files('pdbg-test.dts'),
+ output: 'pdbg-test.dtb',
+ command: [
+ find_program('dtc'),
+ '-I',
+ 'dts',
+ '-O',
+ 'dtb',
+ '-o',
+ '@OUTPUT@',
+ '@INPUT@',
+ ],
+)
pdbg_env = 'PDBG_DTB=' + pdbg_test_dtb.full_path()
################################################################################
# Add gtest/gmock dependency to the list of test dependencies.
-test_deps = [
- test_util_deps,
- gtest_dep,
-]
+test_deps = [test_util_deps, gtest_dep]
-test_vars = [
- pdbg_env,
- 'LG2_FORCE_STDERR=true',
-]
+test_vars = [pdbg_env, 'LG2_FORCE_STDERR=true']
# Additional SRCs that are not (or should not be) included in libraries.
# NOTE: Try to limit this, if possible, to prevent duplicate compilation.
test_additional_srcs = [
- files(
- '../analyzer/filter-root-cause.cpp',
- '../analyzer/plugins/ody-plugins.cpp',
- '../analyzer/plugins/p10-plugins.cpp',
- '../analyzer/plugins/p10-tod-plugins.cpp',
- '../cli.cpp',
- ),
- pdbg_test_dtb
+ files(
+ '../analyzer/filter-root-cause.cpp',
+ '../analyzer/plugins/ody-plugins.cpp',
+ '../analyzer/plugins/p10-plugins.cpp',
+ '../analyzer/plugins/p10-tod-plugins.cpp',
+ '../cli.cpp',
+ ),
+ pdbg_test_dtb,
]
################################################################################
testcases = [
- 'test-bin-stream',
- 'test-ffdc-file',
- 'test-lpc-timeout',
- 'test-pdbg-dts',
- 'test-pll-unlock',
- 'test-resolution',
- 'test-root-cause-filter',
- 'test-tod-step-check-fault',
- 'test-cli',
+ 'test-bin-stream',
+ 'test-ffdc-file',
+ 'test-lpc-timeout',
+ 'test-pdbg-dts',
+ 'test-pll-unlock',
+ 'test-resolution',
+ 'test-root-cause-filter',
+ 'test-tod-step-check-fault',
+ 'test-cli',
]
# allow more time for long running tests
-longtests = {
- 'test-pll-unlock': 2,
-}
+longtests = {'test-pll-unlock': 2}
foreach tc : testcases
- exe = executable(tc.underscorify(),
- sources : [ files(tc + '.cpp'), test_additional_srcs ],
- include_directories : incdir,
- dependencies : test_deps,
- cpp_args : test_args,
- link_with : test_libs,
- )
+ exe = executable(
+ tc.underscorify(),
+ sources: [files(tc + '.cpp'), test_additional_srcs],
+ include_directories: incdir,
+ dependencies: test_deps,
+ cpp_args: test_args,
+ link_with: test_libs,
+ )
- test(tc, exe, env: test_vars, timeout: 30 * longtests.get(tc, 1))
+ test(tc, exe, env: test_vars, timeout: 30 * longtests.get(tc, 1))
endforeach
################################################################################
testcases = [
- 'test-attention',
- 'test-end2end',
- 'test-util-data-file',
- 'test-ti-handler',
+ 'test-attention',
+ 'test-end2end',
+ 'test-util-data-file',
+ 'test-ti-handler',
]
# allow more time for long running tests
-longtests = {
- 'test-end2end': 2,
-}
+longtests = {'test-end2end': 2}
foreach tc : testcases
- exe = executable(tc.underscorify(),
- sources : [ files(tc + '.cpp'), test_additional_srcs ],
- include_directories : incdir,
- dependencies : test_deps,
- cpp_args : test_args,
- link_with : hwdiags_libs, # TODO: should use test_libs instead
- )
+ exe = executable(
+ tc.underscorify(),
+ sources: [files(tc + '.cpp'), test_additional_srcs],
+ include_directories: incdir,
+ dependencies: test_deps,
+ cpp_args: test_args,
+ link_with: hwdiags_libs, # TODO: should use test_libs instead
+ )
- test(tc, exe, env: test_vars, timeout: 30 * longtests.get(tc, 1))
+ test(tc, exe, env: test_vars, timeout: 30 * longtests.get(tc, 1))
endforeach
diff --git a/util/data/meson.build b/util/data/meson.build
index 41aa185..f1673d5 100644
--- a/util/data/meson.build
+++ b/util/data/meson.build
@@ -7,4 +7,4 @@
'peer-targets-rainier-4u.json',
)
-install_data( data_files, install_dir: join_paths(package_dir, 'util-data') )
+install_data(data_files, install_dir: join_paths(package_dir, 'util-data'))
diff --git a/util/meson.build b/util/meson.build
index 29eb802..f68d4fd 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -4,8 +4,8 @@
'dbus.cpp',
'ffdc.cpp',
'ffdc_file.cpp',
- 'pdbg.cpp',
'pdbg-no-sim.cpp',
+ 'pdbg.cpp',
'pldm.cpp',
'temporary_file.cpp',
)
@@ -28,10 +28,10 @@
util_lib = static_library(
'util_lib',
util_src,
- include_directories : incdir,
- dependencies : util_deps,
- cpp_args : [ package_args ],
- install : false,
+ include_directories: incdir,
+ dependencies: util_deps,
+ cpp_args: [package_args],
+ install: false,
)
# Install the util data files