test: add gpiohandle mock impl

Add gpio handle mock implementation for use in testing.

Change-Id: I0fb2d1af4739ad700f62a4e7cbbe62db528bb93e
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/gpio_mock.hpp b/test/gpio_mock.hpp
new file mode 100644
index 0000000..d1acfef
--- /dev/null
+++ b/test/gpio_mock.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <gpioplus/handle.hpp>
+#include <memory>
+#include <string>
+
+#include <gmock/gmock.h>
+
+class GpioHandleInterface
+{
+  public:
+    virtual ~GpioHandleInterface() = default;
+    virtual std::unique_ptr<gpioplus::HandleInterface>
+        build(const std::string& gpiochip, const std::string& line) const = 0;
+};
+
+class GpioHandleMock : public GpioHandleInterface
+{
+  public:
+    virtual ~GpioHandleMock() = default;
+    MOCK_CONST_METHOD2(build, std::unique_ptr<gpioplus::HandleInterface>(
+                                  const std::string&, const std::string&));
+};
+
+// Set this before each test that hits a call to getEnv().
+extern GpioHandleInterface* gpioIntf;