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