[Cmake-commits] CMake branch, next, updated. v3.0.0-4368-gb87f9e1

Brad King brad.king at kitware.com
Fri Jul 18 10:04:41 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  b87f9e1486bbda614e7a7037b46b0ea08cde6392 (commit)
       via  09b2ac38d15509ae8d5c54adbcef050846b56210 (commit)
      from  d87fc2dad7042b5ccbca6704d0ed75eeee646eec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b87f9e1486bbda614e7a7037b46b0ea08cde6392
commit b87f9e1486bbda614e7a7037b46b0ea08cde6392
Merge: d87fc2d 09b2ac3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jul 18 10:04:41 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jul 18 10:04:41 2014 -0400

    Merge topic 'encoding-ctest-fixes' into next
    
    09b2ac38 Encoding:  Fix a few encoding problems with ctest.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09b2ac38d15509ae8d5c54adbcef050846b56210
commit 09b2ac38d15509ae8d5c54adbcef050846b56210
Author:     Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Tue Jul 15 11:11:18 2014 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jul 18 10:05:01 2014 -0400

    Encoding:  Fix a few encoding problems with ctest.
    
    This also fixes some test failures on Windows when the
    name of the build directory contains non-ascii characters.

diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 7c72cba..109905c 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -225,8 +225,8 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
       std::string upload_as
         = url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file);
 
-      struct stat st;
-      if ( ::stat(local_file.c_str(), &st) )
+
+      if ( !cmSystemTools::FileExists(local_file.c_str()) )
         {
         cmCTestLog(this->CTest, ERROR_MESSAGE, "   Cannot find file: "
           << local_file << std::endl);
@@ -234,6 +234,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
         ::curl_global_cleanup();
         return false;
         }
+      unsigned long filelen = cmSystemTools::FileLength(local_file.c_str());
 
       ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
       *this->LogFile << "\tUpload file: " << local_file << " to "
@@ -252,7 +253,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
 
       // and give the size of the upload (optional)
       ::curl_easy_setopt(curl, CURLOPT_INFILESIZE,
-        static_cast<long>(st.st_size));
+        static_cast<long>(filelen));
 
       // and give curl the buffer for errors
       ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer);
@@ -466,8 +467,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
         upload_as += md5;
         }
 
-      struct stat st;
-      if ( ::stat(local_file.c_str(), &st) )
+      if( !cmSystemTools::FileExists(local_file.c_str()) )
         {
         cmCTestLog(this->CTest, ERROR_MESSAGE, "   Cannot find file: "
           << local_file << std::endl);
@@ -475,11 +475,12 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
         ::curl_global_cleanup();
         return false;
         }
+      unsigned long filelen = cmSystemTools::FileLength(local_file.c_str());
 
       ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
       cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "   Upload file: "
         << local_file << " to "
-        << upload_as << " Size: " << st.st_size << std::endl);
+        << upload_as << " Size: " << filelen << std::endl);
 
       // specify target
       ::curl_easy_setopt(curl,CURLOPT_URL, upload_as.c_str());
@@ -489,7 +490,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
 
       // and give the size of the upload (optional)
       ::curl_easy_setopt(curl, CURLOPT_INFILESIZE,
-        static_cast<long>(st.st_size));
+        static_cast<long>(filelen));
 
       // and give curl the buffer for errors
       ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer);
diff --git a/Tests/CTestTestMemcheck/memtester.cxx.in b/Tests/CTestTestMemcheck/memtester.cxx.in
index 55a34e3..43c0ba7 100644
--- a/Tests/CTestTestMemcheck/memtester.cxx.in
+++ b/Tests/CTestTestMemcheck/memtester.cxx.in
@@ -1,11 +1,19 @@
 #include <cmSystemTools.h>
+#include <cmsys/Encoding.hxx>
 #include <string>
+#include <locale.h>
 
 #define RETVAL @_retval@
 
 int
-main(int argc, char **argv)
+main(int ac, char **av)
 {
+  setlocale(LC_CTYPE, "");
+  cmsys::Encoding::CommandLineArguments args =
+    cmsys::Encoding::CommandLineArguments::Main(ac, av);
+  int argc = args.argc();
+  const char* const* argv = args.argv();
+
   std::string exename = argv[0];
   std::string logarg;
   bool nextarg = false;

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list