summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSubmitCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2015-01-14 15:54:25 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-20 14:33:21 (GMT)
commit5dc33f89b5405f1fbcefb9783ea2050a3686d7de (patch)
treed138db877c27238535c72fe56266f21553e5680b /Source/CTest/cmCTestSubmitCommand.cxx
parent17cfa09eb2a78349a6471e4719bc933dd0625d9e (diff)
downloadCMake-5dc33f89b5405f1fbcefb9783ea2050a3686d7de.zip
CMake-5dc33f89b5405f1fbcefb9783ea2050a3686d7de.tar.gz
CMake-5dc33f89b5405f1fbcefb9783ea2050a3686d7de.tar.bz2
ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash
This adds support for the new cdash API where arbitrary files can be uploaded to the CDash server. This CDash API communicates via json files so the json parser jsoncpp was added to the Utilities directory.
Diffstat (limited to 'Source/CTest/cmCTestSubmitCommand.cxx')
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx33
1 files changed, 31 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 4005a63..dcd7982 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
= 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";
@@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
// error: CDash requires CTEST_DROP_LOCATION definition
// in CTestConfig.cmake
}
-
+ this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName);
this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod);
this->CTest->SetCTestConfiguration("DropSite", ctestDropSite);
this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation);
@@ -144,6 +145,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
static_cast<cmCTestSubmitHandler*>(handler)->SetOption("InternalTest",
this->InternalTest ? "ON" : "OFF");
+ if(this->CDashUploadFile.size())
+ {
+ static_cast<cmCTestSubmitHandler*>(handler)->
+ SetOption("CDashUploadFile", this->CDashUploadFile.c_str());
+ static_cast<cmCTestSubmitHandler*>(handler)->
+ SetOption("CDashUploadType", this->CDashUploadType.c_str());
+ }
return handler;
}
@@ -178,6 +186,16 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg)
return true;
}
+ if(arg == "CDASH_UPLOAD")
+ {
+ this->ArgumentDoing = ArgumentDoingCDashUpload;
+ return true;
+ }
+ if(arg == "CDASH_UPLOAD_TYPE")
+ {
+ this->ArgumentDoing = ArgumentDoingCDashUploadType;
+ return true;
+ }
if(arg == "INTERNAL_TEST_CHECKSUM")
{
this->InternalTest = true;
@@ -240,6 +258,17 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
return true;
}
+ if(this->ArgumentDoing == ArgumentDoingCDashUpload)
+ {
+ this->CDashUploadFile = arg;
+ return true;
+ }
+ if(this->ArgumentDoing == ArgumentDoingCDashUploadType)
+ {
+ this->CDashUploadType = arg;
+ return true;
+ }
+
// Look for other arguments.
return this->Superclass::CheckArgumentValue(arg);
}