summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSubmitCommand.cxx
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2017-05-03 14:50:04 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2017-05-04 16:21:21 (GMT)
commit1a7d00bd12f261428edb8fef09461bee8067ceee (patch)
tree7d998892f75ff11470ff6c884d4e168bdddd6c63 /Source/CTest/cmCTestSubmitCommand.cxx
parent294cf948dc37799e1980685afbf1fa585ad5b0fb (diff)
downloadCMake-1a7d00bd12f261428edb8fef09461bee8067ceee.zip
CMake-1a7d00bd12f261428edb8fef09461bee8067ceee.tar.gz
CMake-1a7d00bd12f261428edb8fef09461bee8067ceee.tar.bz2
ctest_submit: Add HTTPHEADER option
Allow CTest script writers to specify additional HTTP headers to be sent to CDash during submission. The motivating case for this feature is a corresponding change in CDash. This will allow projects to refuse submissions from any site not bearing a valid authentication token.
Diffstat (limited to 'Source/CTest/cmCTestSubmitCommand.cxx')
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 5cf4ddc..409eb51 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -129,6 +129,12 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
static_cast<cmCTestSubmitHandler*>(handler)->SelectParts(this->Parts);
}
+ // Pass along any HTTPHEADER to the handler if this option was given.
+ if (!this->HttpHeaders.empty()) {
+ static_cast<cmCTestSubmitHandler*>(handler)->SetHttpHeaders(
+ this->HttpHeaders);
+ }
+
static_cast<cmCTestSubmitHandler*>(handler)->SetOption(
"RetryDelay", this->RetryDelay.c_str());
static_cast<cmCTestSubmitHandler*>(handler)->SetOption(
@@ -182,6 +188,11 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg)
}
}
// Arguments used by both modes.
+ if (arg == "HTTPHEADER") {
+ this->ArgumentDoing = ArgumentDoingHttpHeader;
+ return true;
+ }
+
if (arg == "RETRY_COUNT") {
this->ArgumentDoing = ArgumentDoingRetryCount;
return true;
@@ -230,6 +241,11 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
return true;
}
+ if (this->ArgumentDoing == ArgumentDoingHttpHeader) {
+ this->HttpHeaders.push_back(arg);
+ return true;
+ }
+
if (this->ArgumentDoing == ArgumentDoingRetryCount) {
this->RetryCount = arg;
return true;