summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-18 16:53:48 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-18 16:53:48 (GMT)
commitf47a57c3e8410e5ce78acf67bf239303fa6b27e4 (patch)
treea2c5b968c53804064344b45751f58f0fcf912fff /Source/cmCTest.cxx
parent3d84afe571f03f0f8406a4af95746877b5ee9267 (diff)
downloadCMake-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/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx52
1 files changed, 51 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index a79f75b..442c387 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1188,7 +1188,47 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
}
//----------------------------------------------------------------------
-bool cmCTest::CheckArgument(const std::string& arg, const char* varg1, const char* varg2 = 0)
+bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
+{
+ std::vector<cmStdString>::const_iterator it;
+ for ( it = files.begin();
+ it != files.end();
+ ++ it )
+ {
+ if ( !cmSystemTools::FileExists(it->c_str()) )
+ {
+ cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: " << it->c_str() << " to submit."
+ << std::endl;);
+ return false;
+ }
+ this->AddSubmitFile(it->c_str());
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------
+bool cmCTest::SubmitExtraFiles(const char* cfiles)
+{
+ if ( !cfiles )
+ {
+ return 1;
+ }
+
+ std::vector<cmStdString> files;
+
+ cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
+
+ files = cmSystemTools::SplitString(cfiles, ';');
+ if ( files.size() == 0 )
+ {
+ return 1;
+ }
+
+ return this->SubmitExtraFiles(files);
+}
+
+//----------------------------------------------------------------------
+bool cmCTest::CheckArgument(const std::string& arg, const char* varg1, const char* varg2)
{
cmOStringStream ostr;
ostr << varg1;
@@ -1592,6 +1632,16 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
i++;
this->SetNotesFiles(args[i].c_str());
}
+ if(this->CheckArgument(arg, "--extra-submit") && i < args.size() - 1)
+ {
+ this->m_ProduceXML = true;
+ this->SetTest("Submit");
+ i++;
+ if ( !this->SubmitExtraFiles(args[i].c_str()) )
+ {
+ return 0;
+ }
+ }
// --build-and-test options
if(this->CheckArgument(arg, "--build-and-test") && i < args.size() - 1)
{