power-utils: Initially use i2c in updater
Create I2CDevice in updater and invoke read() in doUpdate(), that could
be used in future.
Use mocked I2CInterface in updater's unit test case.
Tested: Manually verify on Witherspoon that the i2c device is opened
and closed during PSU code update.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ie3d9f0565a2ceb000f489647a58ca967a2ef0c38
diff --git a/tools/power-utils/test/meson.build b/tools/power-utils/test/meson.build
index 45052ad..1f23ad0 100644
--- a/tools/power-utils/test/meson.build
+++ b/tools/power-utils/test/meson.build
@@ -9,7 +9,7 @@
phosphor_logging,
],
implicit_include_directories: false,
- include_directories: '../../..',
+ include_directories: libpower_inc,
link_with: [
libpower,
],
@@ -25,10 +25,11 @@
'../updater.cpp',
dependencies: [
gtest,
+ gmock,
phosphor_logging,
],
implicit_include_directories: false,
- include_directories: '../../..',
+ include_directories: [libpower_inc, libi2c_inc],
link_with: [
libpower,
],