Skip to content
Snippets Groups Projects
Commit d6139c66 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'msys'


5b941f33 SystemTools: Adapt permissions test to MSYS
f00dd83e SystemTools: Avoid unnecessary assumption of working directory in test case
17f4af9b SystemTools: Use octal base for error messages in permission test

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !211
parents 7ab1c601 5b941f33
Branches master
No related tags found
No related merge requests found
......@@ -290,15 +290,17 @@ static bool CheckFileOperations()
res = false;
}
std::cerr << std::oct;
// Reset umask
#if defined(_WIN32) && !defined(__CYGWIN__)
#ifdef __MSYS__
mode_t fullMask = S_IWRITE;
#elif defined(_WIN32) && !defined(__CYGWIN__)
// NOTE: Windows doesn't support toggling _S_IREAD.
mode_t fullMask = _S_IWRITE;
#else
// On a normal POSIX platform, we can toggle all permissions.
mode_t fullMask = S_IRWXU | S_IRWXG | S_IRWXO;
#endif
mode_t orig_umask = umask(fullMask);
// Test file permissions without umask
mode_t origPerm, thisPerm;
......@@ -370,6 +372,7 @@ static bool CheckFileOperations()
res = false;
}
mode_t orig_umask = umask(fullMask);
// Test setting file permissions while honoring umask
if (!kwsys::SystemTools::SetPermissions(testNewFile, fullMask, true)) {
std::cerr << "Problem with SetPermissions (3) for: " << testNewFile
......@@ -496,6 +499,7 @@ static bool CheckFileOperations()
}
#endif
std::cerr << std::dec;
return res;
}
......@@ -1093,7 +1097,7 @@ static bool CheckCopyFileIfDifferent()
ret = false;
continue;
}
std::string bdata = readFile("file_b");
std::string bdata = readFile(cptarget);
if (diff_test_cases[i].a != bdata) {
std::cerr << "Incorrect CopyFileIfDifferent file contents in test case "
<< i + 1 << "." << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment