summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-15 13:28:25 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-18 16:30:49 (GMT)
commit4d1d7725f3e12399dd3785f5ffb7eae7db1be984 (patch)
tree9764acec4f649f8194d310dec9fa6ef22ad7ebf7 /Source/CTest
parent96966b5c804a95677e43e3938c52afbd42b5d48a (diff)
downloadCMake-4d1d7725f3e12399dd3785f5ffb7eae7db1be984.zip
CMake-4d1d7725f3e12399dd3785f5ffb7eae7db1be984.tar.gz
CMake-4d1d7725f3e12399dd3785f5ffb7eae7db1be984.tar.bz2
ctest: Teach --build-options to allow zero options
The --build-options option consumes all following arguments until either --build-target or --test-command. Fix the logic to allow this to be zero options.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx19
1 files changed, 5 insertions, 14 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 807a7e8..0fac136 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -513,23 +513,14 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
{
this->BuildNoClean = true;
}
- if(currentArg.find("--build-options",0) == 0 && idx < allArgs.size() - 1)
+ if(currentArg.find("--build-options",0) == 0)
{
- ++idx;
- bool done = false;
- while(idx < allArgs.size() && !done)
+ while(idx+1 < allArgs.size() &&
+ allArgs[idx+1] != "--build-target" &&
+ allArgs[idx+1] != "--test-command")
{
+ ++idx;
this->BuildOptions.push_back(allArgs[idx]);
- if(idx+1 < allArgs.size()
- && (allArgs[idx+1] == "--build-target" ||
- allArgs[idx+1] == "--test-command"))
- {
- done = true;
- }
- else
- {
- ++idx;
- }
}
}
if(currentArg.find("--test-command",0) == 0 && idx < allArgs.size() - 1)