diff options
author | Brad King <brad.king@kitware.com> | 2018-10-01 13:24:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-10-01 13:24:29 (GMT) |
commit | 17653671e4007004d4d7779b4702c9a85b7d5a65 (patch) | |
tree | 45601d495e22bd4116f09cd83b6935ca582bc5ad /Source/CTest | |
parent | 5cf36d3b0f721f57d80750b4c05cc69d7d1fdc32 (diff) | |
parent | c49d13f94b171bd29b9b403df0e5f19723c4e251 (diff) | |
download | CMake-17653671e4007004d4d7779b4702c9a85b7d5a65.zip CMake-17653671e4007004d4d7779b4702c9a85b7d5a65.tar.gz CMake-17653671e4007004d4d7779b4702c9a85b7d5a65.tar.bz2 |
Merge topic 'no_buildid_for_files'
c49d13f94b ctest: only create buildid when submitting from Testing/ dir
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2423
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index c7f3f39..ecf309a 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -392,8 +392,12 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, ::curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); std::string local_file = file; + bool initialize_cdash_buildid = false; if (!cmSystemTools::FileExists(local_file)) { local_file = localprefix + "/" + file; + // If this file exists within the local Testing directory we assume + // that it will be associated with the current build in CDash. + initialize_cdash_buildid = true; } std::string remote_file = remoteprefix + cmSystemTools::GetFilenameName(file); @@ -425,26 +429,30 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, ((url.find('?') == std::string::npos) ? '?' : '&') + "FileName=" + ofile; - cmCTestCurl ctest_curl(this->CTest); - upload_as += "&build="; - upload_as += - ctest_curl.Escape(this->CTest->GetCTestConfiguration("BuildName")); - upload_as += "&site="; - upload_as += - ctest_curl.Escape(this->CTest->GetCTestConfiguration("Site")); - upload_as += "&stamp="; - upload_as += ctest_curl.Escape(this->CTest->GetCurrentTag()); - upload_as += "-"; - upload_as += ctest_curl.Escape(this->CTest->GetTestModelString()); - cmCTestScriptHandler* ch = - static_cast<cmCTestScriptHandler*>(this->CTest->GetHandler("script")); - cmake* cm = ch->GetCMake(); - if (cm) { - const char* subproject = - cm->GetState()->GetGlobalProperty("SubProject"); - if (subproject) { - upload_as += "&subproject="; - upload_as += ctest_curl.Escape(subproject); + if (initialize_cdash_buildid) { + // Provide extra arguments to CDash so that it can initialize and + // return a buildid. + cmCTestCurl ctest_curl(this->CTest); + upload_as += "&build="; + upload_as += + ctest_curl.Escape(this->CTest->GetCTestConfiguration("BuildName")); + upload_as += "&site="; + upload_as += + ctest_curl.Escape(this->CTest->GetCTestConfiguration("Site")); + upload_as += "&stamp="; + upload_as += ctest_curl.Escape(this->CTest->GetCurrentTag()); + upload_as += "-"; + upload_as += ctest_curl.Escape(this->CTest->GetTestModelString()); + cmCTestScriptHandler* ch = static_cast<cmCTestScriptHandler*>( + this->CTest->GetHandler("script")); + cmake* cm = ch->GetCMake(); + if (cm) { + const char* subproject = + cm->GetState()->GetGlobalProperty("SubProject"); + if (subproject) { + upload_as += "&subproject="; + upload_as += ctest_curl.Escape(subproject); + } } } |