add health_metric_config implementation
Add the health_metric_config interface and implementation for
phosphor-health-monitor. This interface will be used in the
re-write of phosphor-health-monitor.
This change is in relation to following design and D-Bus interface
update-
https://gerrit.openbmc.org/c/openbmc/docs/+/64917
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/64914
gtest added for UT.
Change-Id: Ic40faafbb57597023cc70036428d46ee69a895a2
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..4df0d46
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,38 @@
+gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
+gmock_dep = dependency('gmock', disabler: true, required: false)
+if not gtest_dep.found() or not gmock_dep.found()
+ gtest_proj = import('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').enabled(),
+ 'Googletest is required if tests are enabled'
+ )
+ endif
+endif
+
+test(
+ 'test_health_metric_config',
+ executable(
+ 'test_health_metric_config',
+ 'test_health_metric_config.cpp',
+ '../health_metric_config.cpp',
+ dependencies: [
+ gtest_dep,
+ gmock_dep,
+ phosphor_logging_dep,
+ phosphor_dbus_interfaces_dep,
+ sdbusplus_dep,
+ nlohmann_json_dep
+ ],
+ include_directories: '../',
+ )
+)