MCPcopy Create free account
hub / github.com/Kitware/CMake / copyDirectoryTest

Function copyDirectoryTest

Source/kwsys/testDirectory.cxx:108–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static 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
139int testDirectory(int, char*[])
140{

Callers 1

testDirectoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…