[Cmake-commits] CMake branch, next, updated. v3.1.1-2489-gb54ed1b

Brad King brad.king at kitware.com
Thu Jan 29 17:21:00 EST 2015


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  b54ed1b543f429180945adaabebd5a9f35028391 (commit)
       via  9c0c1ad7924eb773671b605ae3df83b440d3dece (commit)
       via  83b9ceed00b610060a12818150cdf3b4be7c42c0 (commit)
      from  ecc6b91f96be110aed26e2030b599817639d2106 (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=b54ed1b543f429180945adaabebd5a9f35028391
commit b54ed1b543f429180945adaabebd5a9f35028391
Merge: ecc6b91 9c0c1ad
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 29 17:20:59 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jan 29 17:20:59 2015 -0500

    Merge topic 'clean_up_cdash_upload_files' into next
    
    9c0c1ad7 ctest_submit: Escape URL components in CDASH_UPLOAD mode
    83b9ceed Use the --files-from option to tar to handle lots of files, also add a test.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c0c1ad7924eb773671b605ae3df83b440d3dece
commit 9c0c1ad7924eb773671b605ae3df83b440d3dece
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Thu Jan 29 14:42:44 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jan 29 17:18:25 2015 -0500

    ctest_submit: Escape URL components in CDASH_UPLOAD mode
    
    Call curl_easy_escape on arguments sent to CDash upload.

diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index b0d26cc..b4c0137 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -25,6 +25,21 @@ cmCTestCurl::cmCTestCurl(cmCTest* ctest)
   this->VerifyPeerOff = false;
   this->VerifyHostOff = false;
   this->TimeOutSeconds = 0;
+  this->Curl = curl_easy_init();
+}
+
+cmCTestCurl::~cmCTestCurl()
+{
+  ::curl_easy_cleanup(this->Curl);
+  ::curl_global_cleanup();
+}
+
+std::string cmCTestCurl::Escape(std::string const& source)
+{
+  char* data1 = curl_easy_escape(this->Curl, source.c_str(), 0);
+  std::string ret = data1;
+  curl_free(data1);
+  return ret;
 }
 
 namespace
@@ -73,7 +88,6 @@ void cmCTestCurl::SetCurlOptions(std::vector<std::string> const& args)
 
 bool cmCTestCurl::InitCurl()
 {
-  this->Curl = curl_easy_init();
   if(!this->Curl)
     {
     return false;
@@ -160,7 +174,6 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
   // Now run off and do what you've been told!
   ::curl_easy_perform(this->Curl);
   ::fclose(ftpfile);
-  ::curl_global_cleanup();
 
   if ( responseData.size() > 0 )
     {
@@ -213,8 +226,6 @@ bool cmCTestCurl::HttpRequest(std::string const& url,
 
   CURLcode res = ::curl_easy_perform(this->Curl);
 
-  ::curl_easy_cleanup(this->Curl);
-  ::curl_global_cleanup();
   if ( responseData.size() > 0 )
     {
     response = std::string(responseData.begin(), responseData.end());
diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h
index 5bb8b41..0737bb6 100644
--- a/Source/CTest/cmCTestCurl.h
+++ b/Source/CTest/cmCTestCurl.h
@@ -22,6 +22,7 @@ class cmCTestCurl
 {
 public:
   cmCTestCurl(cmCTest*);
+  ~cmCTestCurl();
   bool UploadFile(std::string const& url,
                   std::string const& file,
                   std::string const& fields,
@@ -34,6 +35,7 @@ public:
   void SetCurlOptions(std::vector<std::string> const& args);
   void SetUseHttp10On() { this->UseHttp10 = true;}
   void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;}
+  std::string Escape(std::string const& source);
 protected:
   void SetProxyType();
   bool InitCurl();
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 3d9545f..5b52df7 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -1128,21 +1128,24 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
   // TODO: Encode values for a URL instead of trusting caller.
   std::ostringstream str;
   str << "project="
-      << this->CTest->GetCTestConfiguration("ProjectName") << "&";
+      << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&";
   if(subproject)
     {
-    str << "subproject=" << subproject << "&";
+    str << "subproject=" << curl.Escape(subproject) << "&";
     }
-  str << "stamp=" << this->CTest->GetCurrentTag() << "-"
-      << this->CTest->GetTestModelString() << "&"
-      << "model=" << this->CTest->GetTestModelString() << "&"
-      << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&"
-      << "site=" << this->CTest->GetCTestConfiguration("Site") << "&"
-      << "track=" << this->CTest->GetTestModelString() << "&"
+  str << "stamp=" << curl.Escape(this->CTest->GetCurrentTag()) << "-"
+      << curl.Escape(this->CTest->GetTestModelString()) << "&"
+      << "model=" << curl.Escape(this->CTest->GetTestModelString()) << "&"
+      << "build="
+      << curl.Escape(this->CTest->GetCTestConfiguration("BuildName")) << "&"
+      << "site="
+      << curl.Escape(this->CTest->GetCTestConfiguration("Site")) << "&"
+      << "track="
+      << curl.Escape(this->CTest->GetTestModelString()) << "&"
       << "starttime=" << (int)cmSystemTools::GetTime() << "&"
       << "endtime=" << (int)cmSystemTools::GetTime() << "&"
       << "datafilesmd5[0]=" << md5sum << "&"
-      << "type=" << typeString;
+      << "type=" << curl.Escape(typeString);
   std::string fields = str.str();
   cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:"
              << url << "\nfile: " << file << "\n");
@@ -1192,9 +1195,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
 
   std::string upload_as = cmSystemTools::GetFilenameName(file);
   std::ostringstream fstr;
-  fstr << "type=" << typeString << "&"
+  fstr << "type=" << curl.Escape(typeString) << "&"
        << "md5=" << md5sum << "&"
-       << "filename=" << upload_as << "&"
+       << "filename=" << curl.Escape(upload_as) << "&"
        << "buildid=" << json["buildid"].asString();
   if(!curl.UploadFile(file, url, fstr.str(), response))
     {

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83b9ceed00b610060a12818150cdf3b4be7c42c0
commit 83b9ceed00b610060a12818150cdf3b4be7c42c0
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Wed Jan 28 17:08:41 2015 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jan 29 17:18:24 2015 -0500

    Use the --files-from option to tar to handle lots of files, also add a test.

diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index f6616e0..edb1466 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -39,6 +39,13 @@
 #   ``GCOV_COMMAND <gcov_command>``
 #     Specify the full path to the ``gcov`` command on the machine.
 #     Default is the value of :variable:`CTEST_COVERAGE_COMMAND`.
+#
+#   ``GCOV_EXTRA_OPTIONS <extra options>``
+#     Specify extra options to be passed to gcov.  By default
+#     gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path}
+#     If GCOV_EXTRA_OPTIONS are specified, it will be run like this:
+#     ``gcov`` ${GCOV_EXTRA_OPTIONS}  ${gcov_dir} ${gcda_file_path}
+
 
 #=============================================================================
 # Copyright 2014-2015 Kitware, Inc.
@@ -56,7 +63,7 @@ include(CMakeParseArguments)
 function(ctest_coverage_collect_gcov)
   set(options "")
   set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND)
-  set(multiValueArgs "")
+  set(multiValueArgs GCOV_EXTRA_OPTIONS)
   cmake_parse_arguments(GCOV  "${options}" "${oneValueArgs}"
     "${multiValueArgs}" "" ${ARGN} )
   if(NOT DEFINED GCOV_TARBALL)
@@ -86,7 +93,7 @@ function(ctest_coverage_collect_gcov)
   # this will be faster and only look where the files will be
   file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs)
   foreach(target_dir ${target_dirs})
-    file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda")
+    file(GLOB_RECURSE gfiles RELATIVE "${binary_dir}" ${target_dir}/*.gcda)
     list(LENGTH gfiles len)
     # if we have gcda files then also grab the labels file for that target
     if(${len} GREATER 0)
@@ -113,11 +120,18 @@ function(ctest_coverage_collect_gcov)
     get_filename_component(gcov_dir ${gcda_file} DIRECTORY)
     # run gcov, this will produce the .gcov file in the current
     # working directory
+    if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS)
+      set(GCOV_GCOV_EXTRA_OPTIONS -b -o)
+    endif()
     execute_process(COMMAND
-      ${gcov_command} -b -o ${gcov_dir} ${gcda_file}
+      ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file}
       OUTPUT_VARIABLE out
+      RESULT_VARIABLE res
       WORKING_DIRECTORY ${coverage_dir})
   endforeach()
+  if(NOT "${res}" EQUAL 0)
+    message(STATUS "Error running gcov: ${res} ${out}")
+  endif()
   # create json file with project information
   file(WRITE ${coverage_dir}/data.json
     "{
@@ -130,9 +144,16 @@ function(ctest_coverage_collect_gcov)
   # tar up the coverage info with the same date so that the md5
   # sum will be the same for the tar file independent of file time
   # stamps
+  string(REPLACE ";" "\n" gcov_files "${gcov_files}")
+  string(REPLACE ";" "\n" label_files "${label_files}")
+  file(WRITE "${coverage_dir}/coverage_file_list.txt"
+    "${gcov_files}
+${coverage_dir}/data.json
+${label_files}
+")
   execute_process(COMMAND
     ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL}
-    "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files}
-    ${coverage_dir}/data.json  ${label_files}
+    "--mtime=1970-01-01 0:0:0 UTC"
+    --files-from=${coverage_dir}/coverage_file_list.txt
     WORKING_DIRECTORY ${binary_dir})
 endfunction()

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list