diff options
author | KWSys Upstream <kwrobot@kitware.com> | 2021-04-19 13:26:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-04-19 13:46:55 (GMT) |
commit | d98342d868a51f2c777f0424d2ea04f2fb1fd3ca (patch) | |
tree | 93c333d94b9c7f3fe755afb3689b3512ab7d8a2e | |
parent | a790167101290eaf77d7a3ef8fd807160af1b9a9 (diff) | |
download | CMake-d98342d868a51f2c777f0424d2ea04f2fb1fd3ca.zip CMake-d98342d868a51f2c777f0424d2ea04f2fb1fd3ca.tar.gz CMake-d98342d868a51f2c777f0424d2ea04f2fb1fd3ca.tar.bz2 |
KWSys 2021-04-19 (d6139c66)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit d6139c66c8760552ab6bc4a08401ae8105217469 (master).
Upstream Shortlog
-----------------
Orgad Shaneh (3):
17f4af9b SystemTools: Use octal base for error messages in permission test
f00dd83e SystemTools: Avoid unnecessary assumption of working directory in test case
5b941f33 SystemTools: Adapt permissions test to MSYS
-rw-r--r-- | testSystemTools.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/testSystemTools.cxx b/testSystemTools.cxx index cfa420d..04f66ff 100644 --- a/testSystemTools.cxx +++ b/testSystemTools.cxx @@ -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; |