summaryrefslogtreecommitdiff
path: root/test/testenv.hh
blob: abe0bc89f39565381e07412a888af713a0ecd9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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