Bladeren bron

CDashUpload: Use the query part of the submit url as field

Regina Pfeifer 7 jaren geleden
bovenliggende
commit
36bbd07a76
2 gewijzigde bestanden met toevoegingen van 6 en 7 verwijderingen
  1. 0 4
      Source/CTest/cmCTestSubmitCommand.cxx
  2. 6 3
      Source/CTest/cmCTestSubmitHandler.cxx

+ 0 - 4
Source/CTest/cmCTestSubmitCommand.cxx

@@ -23,8 +23,6 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
   const char* ctestTriggerSite =
     this->Makefile->GetDefinition("CTEST_TRIGGER_SITE");
   bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH");
-  const char* ctestProjectName =
-    this->Makefile->GetDefinition("CTEST_PROJECT_NAME");
   if (!ctestDropMethod) {
     ctestDropMethod = "http";
   }
@@ -37,8 +35,6 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
     // error: CDash requires CTEST_DROP_LOCATION definition
     // in CTestConfig.cmake
   }
-  this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName,
-                                     this->Quiet);
   this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod,
                                      this->Quiet);
   this->CTest->SetCTestConfiguration("DropSite", ctestDropSite, this->Quiet);

+ 6 - 3
Source/CTest/cmCTestSubmitHandler.cxx

@@ -1084,8 +1084,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
   std::string dropMethod;
   std::string url;
   this->ConstructCDashURL(dropMethod, url);
+  std::string fields;
   std::string::size_type pos = url.find('?');
   if (pos != std::string::npos) {
+    fields = url.substr(pos + 1);
     url = url.substr(0, pos);
   }
   if (!(dropMethod == "http" || dropMethod == "https")) {
@@ -1135,8 +1137,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
   const char* subproject = cm->GetState()->GetGlobalProperty("SubProject");
   // TODO: Encode values for a URL instead of trusting caller.
   std::ostringstream str;
-  str << "project="
-      << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&";
   if (subproject) {
     str << "subproject=" << curl.Escape(subproject) << "&";
   }
@@ -1154,7 +1154,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
       << "endtime=" << timeNow << "&"
       << "datafilesmd5[0]=" << md5sum << "&"
       << "type=" << curl.Escape(typeString);
-  std::string fields = str.str();
+  if (!fields.empty()) {
+    fields += '&';
+  }
+  fields += str.str();
   cmCTestOptionalLog(this->CTest, DEBUG,
                      "fields: " << fields << "\nurl:" << url
                                 << "\nfile: " << file << "\n",