blob: 0e659f80eee081c364eb286c96f5096d3e2dbdc9 [file] [log] [blame]
Patrick Venturee3e0f972018-12-19 08:58:21 -08001#pragma once
2
3#include <gpioplus/handle.hpp>
Patrick Williamse8771fd2023-05-10 07:51:06 -05004
Patrick Venturee3e0f972018-12-19 08:58:21 -08005#include <memory>
6#include <string>
7
8#include <gmock/gmock.h>
9
10class GpioHandleInterface
11{
12 public:
13 virtual ~GpioHandleInterface() = default;
14 virtual std::unique_ptr<gpioplus::HandleInterface>
15 build(const std::string& gpiochip, const std::string& line) const = 0;
16};
17
18class GpioHandleMock : public GpioHandleInterface
19{
20 public:
21 virtual ~GpioHandleMock() = default;
22 MOCK_CONST_METHOD2(build, std::unique_ptr<gpioplus::HandleInterface>(
23 const std::string&, const std::string&));
24};
25
26// Set this before each test that hits a call to getEnv().
27extern GpioHandleInterface* gpioIntf;