Tests the archive APIs for a simple file.
| 69 | |
| 70 | // Tests the archive APIs for a simple file. |
| 71 | TEST_F_TEMP_DISABLED_ON_WINDOWS(TarTest, File) |
| 72 | { |
| 73 | // Create a test file. |
| 74 | const Path testFile("testfile"); |
| 75 | ASSERT_SOME(createTestFile(testFile)); |
| 76 | |
| 77 | // Archive the test file. |
| 78 | const Path outputTarFile("test.tar"); |
| 79 | AWAIT_ASSERT_READY(command::tar(testFile, outputTarFile, None())); |
| 80 | ASSERT_TRUE(os::exists(outputTarFile)); |
| 81 | |
| 82 | // Remove the test file to make sure untar process creates new test file. |
| 83 | ASSERT_SOME(os::rm(testFile)); |
| 84 | ASSERT_FALSE(os::exists(testFile)); |
| 85 | |
| 86 | // Untar the tarball and verify that the original file is created. |
| 87 | AWAIT_ASSERT_READY(command::untar(outputTarFile)); |
| 88 | ASSERT_TRUE(os::exists(testFile)); |
| 89 | |
| 90 | // Verify that the content is same as original file. |
| 91 | EXPECT_SOME_EQ("test", os::read(testFile)); |
| 92 | } |
| 93 | |
| 94 | |
| 95 | // Tests the archive APIs for a simple directory. |
nothing calls this directly
no test coverage detected