xref: /openbmc/phosphor-hwmon/test/gpio.cpp (revision e3e0f97d648d7251f6670289ae38284c79686e47)
1 #include "gpio_mock.hpp"
2 
3 #include <memory>
4 #include <string>
5 
6 // Set this before each test that hits a call to getEnv().
7 GpioHandleInterface* gpioIntf;
8 
9 namespace gpio
10 {
11 
12 std::unique_ptr<gpioplus::HandleInterface>
BuildGpioHandle(const std::string & gpiochip,const std::string & line)13     BuildGpioHandle(const std::string& gpiochip, const std::string& line)
14 {
15     return (gpioIntf) ? gpioIntf->build(gpiochip, line) : nullptr;
16 }
17 
18 } // namespace gpio
19