| 106 | } |
| 107 | |
| 108 | static int copyDirectoryTest() |
| 109 | { |
| 110 | using namespace kwsys; |
| 111 | std::string const source(TEST_SYSTEMTOOLS_BINARY_DIR |
| 112 | "/directory_testing/copyDirectoryTestSrc"); |
| 113 | if (SystemTools::PathExists(source)) { |
| 114 | std::cerr << source << " shouldn't exist before test" << std::endl; |
| 115 | return 1; |
| 116 | } |
| 117 | std::string const destination(TEST_SYSTEMTOOLS_BINARY_DIR |
| 118 | "/directory_testing/copyDirectoryTestDst"); |
| 119 | if (SystemTools::PathExists(destination)) { |
| 120 | std::cerr << destination << " shouldn't exist before test" << std::endl; |
| 121 | return 2; |
| 122 | } |
| 123 | Status const copysuccess = SystemTools::CopyADirectory(source, destination); |
| 124 | bool const destinationexists = SystemTools::PathExists(destination); |
| 125 | if (copysuccess.IsSuccess()) { |
| 126 | std::cerr << "CopyADirectory should have returned false" << std::endl; |
| 127 | SystemTools::RemoveADirectory(destination); |
| 128 | return 3; |
| 129 | } |
| 130 | if (destinationexists) { |
| 131 | std::cerr << "CopyADirectory returned false, but destination directory" |
| 132 | << " has been created" << std::endl; |
| 133 | SystemTools::RemoveADirectory(destination); |
| 134 | return 4; |
| 135 | } |
| 136 | return 0; |
| 137 | } |
| 138 | |
| 139 | int testDirectory(int, char*[]) |
| 140 | { |
no outgoing calls
no test coverage detected
searching dependent graphs…