diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-07-18 16:53:48 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-07-18 16:53:48 (GMT) |
commit | f47a57c3e8410e5ce78acf67bf239303fa6b27e4 (patch) | |
tree | a2c5b968c53804064344b45751f58f0fcf912fff /Source/CTest | |
parent | 3d84afe571f03f0f8406a4af95746877b5ee9267 (diff) | |
download | CMake-f47a57c3e8410e5ce78acf67bf239303fa6b27e4.zip CMake-f47a57c3e8410e5ce78acf67bf239303fa6b27e4.tar.gz CMake-f47a57c3e8410e5ce78acf67bf239303fa6b27e4.tar.bz2 |
ENH: Add a way to submit extra files to the dashboard
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 19 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 24 |
2 files changed, 37 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 81252a7..3026e92 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -97,6 +97,25 @@ bool cmCTestSubmitCommand::InitialPass( } m_CTest->GenerateNotesFile(newNotesFiles); } + const char* extraFilesVariable = m_Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES"); + if (extraFilesVariable) + { + std::vector<std::string> extraFiles; + std::vector<cmStdString> newExtraFiles; + cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles); + std::vector<std::string>::iterator it; + for ( it = extraFiles.begin(); + it != extraFiles.end(); + ++ it ) + { + newExtraFiles.push_back(*it); + } + if ( !m_CTest->SubmitExtraFiles(newExtraFiles)) + { + this->SetError("problem submitting extra files."); + return false; + } + } cmCTestGenericHandler* handler = m_CTest->GetInitializedHandler("submit"); if ( !handler ) diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 45fbcfc..a292f06 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -120,8 +120,12 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix, // enable uploading ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1) ; - cmStdString local_file = localprefix + "/" + *file; - cmStdString upload_as = url + "/" + remoteprefix + *file; + cmStdString local_file = *file; + if ( !cmSystemTools::FileExists(local_file.c_str()) ) + { + local_file = localprefix + "/" + *file; + } + cmStdString upload_as = url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file); struct stat st; if ( ::stat(local_file.c_str(), &st) ) @@ -246,8 +250,12 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, ::curl_easy_setopt(curl, CURLOPT_PUT, 1); ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); - cmStdString local_file = localprefix + "/" + *file; - cmStdString remote_file = remoteprefix + *file; + cmStdString local_file = *file; + if ( !cmSystemTools::FileExists(local_file.c_str()) ) + { + local_file = localprefix + "/" + *file; + } + cmStdString remote_file = remoteprefix + remoteprefix + cmSystemTools::GetFilenameName(*file); *m_LogFile << "\tUpload file: " << local_file.c_str() << " to " << remote_file.c_str() << std::endl; @@ -401,7 +409,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<cmStdString>& files, ::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk); ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug); - cmStdString rfile = remoteprefix + *file; + cmStdString rfile = remoteprefix + cmSystemTools::GetFilenameName(*file); cmStdString ofile = ""; cmStdString::iterator kk; for ( kk = rfile.begin(); kk < rfile.end(); ++ kk) @@ -581,7 +589,11 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix, { xmlrpc_value *result; - std::string local_file = localprefix + "/" + *file; + cmStdString local_file = *file; + if ( !cmSystemTools::FileExists(local_file.c_str()) ) + { + local_file = localprefix + "/" + *file; + } cmCTestLog(m_CTest, HANDLER_OUTPUT, " Submit file: " << local_file.c_str() << std::endl); struct stat st; if ( ::stat(local_file.c_str(), &st) ) |