pseq: Add method to Services class to create GPIO
In the phosphor-power-sequencer application, add a method to the
Services class to create a GPIO object. This object can be used to
get/set the GPIO value.
Add the method to the entire Services class hierarchy:
- Services: Abstract base class
- BMCServices: Real implementation of Services interface
- MockServices: Mock implementation of Services interface for automated
testing
Tested:
* Ran automated test cases
Change-Id: I77120843b4124a1ad8d6617bc78cec02ce2ff557
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/test/mock_services.hpp b/phosphor-power-sequencer/test/mock_services.hpp
index cb1d445..8a13b6a 100644
--- a/phosphor-power-sequencer/test/mock_services.hpp
+++ b/phosphor-power-sequencer/test/mock_services.hpp
@@ -15,6 +15,7 @@
*/
#pragma once
+#include "mock_gpio.hpp"
#include "mock_pmbus.hpp"
#include "services.hpp"
@@ -50,6 +51,12 @@
(override));
MOCK_METHOD(bool, isPresent, (const std::string& inventoryPath),
(override));
+
+ virtual std::unique_ptr<GPIO> createGPIO(const std::string&) override
+ {
+ return std::make_unique<MockGPIO>();
+ }
+
MOCK_METHOD(std::vector<int>, getGPIOValues, (const std::string& chipLabel),
(override));