Austin Schuh | c243b42 | 2020-10-11 15:35:08 -0700 | [diff] [blame] | 1 | #include "aos/testing/tmpdir.h" |
2 | |||||
3 | #include <cstdlib> | ||||
4 | #include <string> | ||||
5 | |||||
6 | namespace aos { | ||||
7 | namespace testing { | ||||
8 | |||||
9 | std::string TestTmpDir() { | ||||
10 | const char *tmp_dir = std::getenv("TEST_TMPDIR"); | ||||
11 | if (tmp_dir != nullptr) { | ||||
12 | return tmp_dir; | ||||
13 | } | ||||
14 | return "/tmp"; | ||||
15 | } | ||||
16 | |||||
17 | } // namespace testing | ||||
18 | } // namespace aos |