summaryrefslogtreecommitdiff
path: root/test/testenv.hh
diff options
context:
space:
mode:
Diffstat (limited to 'test/testenv.hh')
-rw-r--r--test/testenv.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/testenv.hh b/test/testenv.hh
new file mode 100644
index 0000000..abe0bc8
--- /dev/null
+++ b/test/testenv.hh
@@ -0,0 +1,22 @@
+#ifndef TESTENV_HH
+#define TESTENV_HH
+
+#include <gtest/gtest.h>
+#include <map>
+#include <optional>
+#include <string>
+
+class TestEnv : public testing::Test {
+ protected:
+ void setenv(std::string const& name, std::string const& value);
+ void unsetenv(std::string const& name);
+
+ void TearDown() override;
+
+ private:
+ void saveenv(std::string const& name);
+
+ std::map<std::string, std::optional<std::string>> env_;
+};
+
+#endif // TESTENV_HH