|
|
@@ -204,6 +204,14 @@ static bool CheckFileOperations()
|
|
|
<< testNewDir << std::endl;
|
|
|
res = false;
|
|
|
}
|
|
|
+ // check existence
|
|
|
+ if (!kwsys::SystemTools::PathExists(testNewDir))
|
|
|
+ {
|
|
|
+ std::cerr
|
|
|
+ << "Problem with PathExists for: "
|
|
|
+ << testNewDir << std::endl;
|
|
|
+ res = false;
|
|
|
+ }
|
|
|
// remove it
|
|
|
if (!kwsys::SystemTools::RemoveADirectory(testNewDir))
|
|
|
{
|
|
|
@@ -221,6 +229,15 @@ static bool CheckFileOperations()
|
|
|
<< testNewDir << std::endl;
|
|
|
res = false;
|
|
|
}
|
|
|
+ // check existence
|
|
|
+ if (kwsys::SystemTools::PathExists(testNewDir))
|
|
|
+ {
|
|
|
+ std::cerr
|
|
|
+ << "After RemoveADirectory: "
|
|
|
+ << "Problem with PathExists for: "
|
|
|
+ << testNewDir << std::endl;
|
|
|
+ res = false;
|
|
|
+ }
|
|
|
// create it using the char* version
|
|
|
if (!kwsys::SystemTools::MakeDirectory(testNewDir.c_str()))
|
|
|
{
|
|
|
@@ -329,6 +346,31 @@ static bool CheckFileOperations()
|
|
|
res = false;
|
|
|
}
|
|
|
|
|
|
+ // calling with an empty string should return false
|
|
|
+ if (kwsys::SystemTools::PathExists(std::string()))
|
|
|
+ {
|
|
|
+ std::cerr
|
|
|
+ << "Problem with PathExists(std::string())"
|
|
|
+ << std::endl;
|
|
|
+ res = false;
|
|
|
+ }
|
|
|
+ // PathExists(x) should return true on a directory
|
|
|
+ if (!kwsys::SystemTools::PathExists(testNewDir))
|
|
|
+ {
|
|
|
+ std::cerr
|
|
|
+ << "Problem with PathExists for: "
|
|
|
+ << testNewDir << std::endl;
|
|
|
+ res = false;
|
|
|
+ }
|
|
|
+ // should work, was created as new file before
|
|
|
+ if (!kwsys::SystemTools::PathExists(testNewFile))
|
|
|
+ {
|
|
|
+ std::cerr
|
|
|
+ << "Problem with PathExists for: "
|
|
|
+ << testNewDir << std::endl;
|
|
|
+ res = false;
|
|
|
+ }
|
|
|
+
|
|
|
// Reset umask
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
|
// NOTE: Windows doesn't support toggling _S_IREAD.
|