blob: b833b9b371e414a8be0a146fcde760d76b8e148f [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;
Patrick Williams94539af2025-02-01 08:22:58 -050014 virtual std::unique_ptr<gpioplus::HandleInterface> build(
15 const std::string& gpiochip, const std::string& line) const = 0;
Patrick Venturee3e0f972018-12-19 08:58:21 -080016};
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;