gtest: Add a testcase wrapper for handling tmpdirs

This makes it trivial to have a pristine temp directory on every test
case execution. Just derive from the provided class.

Change-Id: I5355914cdedc482eddd0749a9ccc10fc93de6571
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/gtest/tmp.cpp b/test/gtest/tmp.cpp
new file mode 100644
index 0000000..f473175
--- /dev/null
+++ b/test/gtest/tmp.cpp
@@ -0,0 +1,43 @@
+#include <filesystem>
+#include <gtest/gtest.h>
+#include <stdplus/gtest/tmp.hpp>
+
+namespace stdplus
+{
+namespace gtest
+{
+
+class TestWithTmpTest : public TestWithTmp
+{
+};
+
+TEST_F(TestWithTmpTest, One)
+{
+    EXPECT_TRUE(std::filesystem::create_directory(
+        std::filesystem::path(CaseTmpDir()) / "a"));
+    EXPECT_TRUE(std::filesystem::create_directory(
+        std::filesystem::path(SuiteTmpDir()) / "a"));
+}
+
+TEST_F(TestWithTmpTest, Two)
+{
+    EXPECT_TRUE(std::filesystem::create_directory(
+        std::filesystem::path(CaseTmpDir()) / "a"));
+    EXPECT_FALSE(std::filesystem::create_directory(
+        std::filesystem::path(SuiteTmpDir()) / "a"));
+}
+
+class TestWithTmpTest2 : public TestWithTmp
+{
+};
+
+TEST_F(TestWithTmpTest2, One)
+{
+    EXPECT_TRUE(std::filesystem::create_directory(
+        std::filesystem::path(SuiteTmpDir()) / "a"));
+    EXPECT_TRUE(std::filesystem::create_directory(
+        std::filesystem::path(CaseTmpDir()) / "a"));
+}
+
+} // namespace gtest
+} // namespace stdplus