diff options
author | Brad King <brad.king@kitware.com> | 2018-11-27 13:48:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-11-27 13:48:49 (GMT) |
commit | bae71966fb35649dda8fc4f962316e3dbea8f787 (patch) | |
tree | f65819995f54f12c998d5b93d813855e5a53d866 /Source/CTest | |
parent | 2a6e8644dd9650c7c749990410a5c50f12a786cb (diff) | |
parent | d9195ab081b9c23a96d5a9c1b8e8be4da4f6e976 (diff) | |
download | CMake-bae71966fb35649dda8fc4f962316e3dbea8f787.zip CMake-bae71966fb35649dda8fc4f962316e3dbea8f787.tar.gz CMake-bae71966fb35649dda8fc4f962316e3dbea8f787.tar.bz2 |
Merge topic 'ctest-updates'
d9195ab081 Tests: Teach run_ctest to handle removal of CTestConfig.cmake
1ca53f5ef1 Remove unnecessary CTEST_PROJECT_NAME variables
15ac4aae0e Remove warning when no CTestConfig.cmake file exists
3125c47d27 ctest_build: Do not require unnecessary [CTEST_]PROJECT_NAME value
36bbd07a76 CDashUpload: Use the query part of the submit url as field
e1dfe8cee6 CTest: Don't require 'submit.php?' in submit location
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2640
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildCommand.cxx | 16 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 15 |
3 files changed, 12 insertions, 23 deletions
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index ce27da1..65b4976 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -53,10 +53,6 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() } else { const char* cmakeGeneratorName = this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR"); - const char* cmakeProjectName = - (this->Values[ctb_PROJECT_NAME] && *this->Values[ctb_PROJECT_NAME]) - ? this->Values[ctb_PROJECT_NAME] - : this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); // Build configuration is determined by: CONFIGURATION argument, // or CTEST_BUILD_CONFIGURATION script variable, or @@ -81,8 +77,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() ? this->Values[ctb_TARGET] : this->Makefile->GetDefinition("CTEST_BUILD_TARGET"); - if (cmakeGeneratorName && *cmakeGeneratorName && cmakeProjectName && - *cmakeProjectName) { + if (cmakeGeneratorName && *cmakeGeneratorName) { if (!cmakeBuildConfiguration) { cmakeBuildConfiguration = "Release"; } @@ -132,14 +127,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() /* clang-format off */ ostr << "has no project to build. If this is a " "\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR " - "and CTEST_PROJECT_NAME are set." - "\n" - "CTEST_PROJECT_NAME is usually set in CTestConfig.cmake. Verify " - "that CTestConfig.cmake exists, or CTEST_PROJECT_NAME " - "is set in the script, or PROJECT_NAME is passed as an argument " - "to ctest_build." - "\n" - "Alternatively, set CTEST_BUILD_COMMAND to build the project " + "is set. Otherwise, set CTEST_BUILD_COMMAND to build the project " "with a custom command line."; /* clang-format on */ this->SetError(ostr.str()); diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 34adb4a..60029ab 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/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); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 98872a5..061c8ef 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1084,8 +1084,12 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string dropMethod; std::string url; this->ConstructCDashURL(dropMethod, url); - std::string::size_type pos = url.find("submit.php?"); - url = url.substr(0, pos + 10); + 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")) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Only http and https are supported for CDASH_UPLOAD\n"); @@ -1133,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) << "&"; } @@ -1152,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", |