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