1e3e0f97dSPatrick Venture #pragma once 2e3e0f97dSPatrick Venture 3e3e0f97dSPatrick Venture #include <gpioplus/handle.hpp> 4*e8771fd4SPatrick Williams 5e3e0f97dSPatrick Venture #include <memory> 6e3e0f97dSPatrick Venture #include <string> 7e3e0f97dSPatrick Venture 8e3e0f97dSPatrick Venture #include <gmock/gmock.h> 9e3e0f97dSPatrick Venture 10e3e0f97dSPatrick Venture class GpioHandleInterface 11e3e0f97dSPatrick Venture { 12e3e0f97dSPatrick Venture public: 13e3e0f97dSPatrick Venture virtual ~GpioHandleInterface() = default; 14e3e0f97dSPatrick Venture virtual std::unique_ptr<gpioplus::HandleInterface> 15e3e0f97dSPatrick Venture build(const std::string& gpiochip, const std::string& line) const = 0; 16e3e0f97dSPatrick Venture }; 17e3e0f97dSPatrick Venture 18e3e0f97dSPatrick Venture class GpioHandleMock : public GpioHandleInterface 19e3e0f97dSPatrick Venture { 20e3e0f97dSPatrick Venture public: 21e3e0f97dSPatrick Venture virtual ~GpioHandleMock() = default; 22e3e0f97dSPatrick Venture MOCK_CONST_METHOD2(build, std::unique_ptr<gpioplus::HandleInterface>( 23e3e0f97dSPatrick Venture const std::string&, const std::string&)); 24e3e0f97dSPatrick Venture }; 25e3e0f97dSPatrick Venture 26e3e0f97dSPatrick Venture // Set this before each test that hits a call to getEnv(). 27e3e0f97dSPatrick Venture extern GpioHandleInterface* gpioIntf; 28