summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSubmitCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-12 15:38:27 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-12 15:38:27 (GMT)
commitd66c25c2f05ce57e879360f2db90a4f8ca4da330 (patch)
treed10fc9cb841476bce7719b39d4c2f1b12890ce9c /Source/CTest/cmCTestSubmitCommand.cxx
parent447f5b303eab1b076f49ed52af90e554160dddc6 (diff)
downloadCMake-d66c25c2f05ce57e879360f2db90a4f8ca4da330.zip
CMake-d66c25c2f05ce57e879360f2db90a4f8ca4da330.tar.gz
CMake-d66c25c2f05ce57e879360f2db90a4f8ca4da330.tar.bz2
ENH: Teach ctest_submit about parts
This adds a PARTS option to the ctest_submit command which tells it to submit only parts whose names are listed with the option.
Diffstat (limited to 'Source/CTest/cmCTestSubmitCommand.cxx')
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx46
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index a321c3f..2e435a7 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -18,6 +18,7 @@
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
+#include "cmCTestSubmitHandler.h"
cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
{
@@ -106,7 +107,52 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->SetError("internal CTest error. Cannot instantiate submit handler");
return 0;
}
+
+ // If a PARTS option was given, select only the named parts for submission.
+ if(!this->Parts.empty())
+ {
+ static_cast<cmCTestSubmitHandler*>(handler)->SelectParts(this->Parts);
+ }
return handler;
}
+
+//----------------------------------------------------------------------------
+bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg)
+{
+ // Look for arguments specific to this command.
+ if(arg == "PARTS")
+ {
+ this->ArgumentDoing = ArgumentDoingParts;
+ return true;
+ }
+
+ // Look for other arguments.
+ return this->Superclass::CheckArgumentKeyword(arg);
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
+{
+ // Handle states specific to this command.
+ if(this->ArgumentDoing == ArgumentDoingParts)
+ {
+ cmCTest::Part p = this->CTest->GetPartFromName(arg.c_str());
+ if(p != cmCTest::PartCount)
+ {
+ this->Parts.insert(p);
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "Part name \"" << arg << "\" is invalid.";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->ArgumentDoing = ArgumentDoingError;
+ }
+ return true;
+ }
+
+ // Look for other arguments.
+ return this->Superclass::CheckArgumentValue(arg);
+}