William A. Kennington III | 953de36 | 2022-07-13 17:32:55 -0700 | [diff] [blame] | 1 | #include <filesystem> |
| 2 | #include <gtest/gtest.h> |
| 3 | #include <stdplus/gtest/tmp.hpp> |
| 4 | |
| 5 | namespace stdplus |
| 6 | { |
| 7 | namespace gtest |
| 8 | { |
| 9 | |
| 10 | class TestWithTmpTest : public TestWithTmp |
| 11 | { |
| 12 | }; |
| 13 | |
| 14 | TEST_F(TestWithTmpTest, One) |
| 15 | { |
| 16 | EXPECT_TRUE(std::filesystem::create_directory( |
| 17 | std::filesystem::path(CaseTmpDir()) / "a")); |
| 18 | EXPECT_TRUE(std::filesystem::create_directory( |
| 19 | std::filesystem::path(SuiteTmpDir()) / "a")); |
| 20 | } |
| 21 | |
| 22 | TEST_F(TestWithTmpTest, Two) |
| 23 | { |
| 24 | EXPECT_TRUE(std::filesystem::create_directory( |
| 25 | std::filesystem::path(CaseTmpDir()) / "a")); |
| 26 | EXPECT_FALSE(std::filesystem::create_directory( |
| 27 | std::filesystem::path(SuiteTmpDir()) / "a")); |
| 28 | } |
| 29 | |
| 30 | class TestWithTmpTest2 : public TestWithTmp |
| 31 | { |
| 32 | }; |
| 33 | |
| 34 | TEST_F(TestWithTmpTest2, One) |
| 35 | { |
| 36 | EXPECT_TRUE(std::filesystem::create_directory( |
| 37 | std::filesystem::path(SuiteTmpDir()) / "a")); |
| 38 | EXPECT_TRUE(std::filesystem::create_directory( |
| 39 | std::filesystem::path(CaseTmpDir()) / "a")); |
| 40 | } |
| 41 | |
| 42 | } // namespace gtest |
| 43 | } // namespace stdplus |