diff options
author | David Cole <david.cole@kitware.com> | 2012-06-24 10:16:32 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2012-06-24 12:03:24 (GMT) |
commit | 93d084c180fde5bc3c31b9945ea7ddb06d9a6007 (patch) | |
tree | d5e21412dc94d4105acfdbf2c12c97cc0d8fc9d8 /Source/cmCTest.cxx | |
parent | af298480d020e814fa4537ca7d7dd44d472489b5 (diff) | |
download | CMake-93d084c180fde5bc3c31b9945ea7ddb06d9a6007.zip CMake-93d084c180fde5bc3c31b9945ea7ddb06d9a6007.tar.gz CMake-93d084c180fde5bc3c31b9945ea7ddb06d9a6007.tar.bz2 |
CTest: Extend -D command line arg handling for variable definitions
If the argument following -D is not a valid dashboard type string,
then try to parse it as a "var:type=value" string just like cmake
already does.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index cc4a341..05e8237 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2230,6 +2230,22 @@ void cmCTest::HandleScriptArguments(size_t &i, } //---------------------------------------------------------------------- +bool cmCTest::AddVariableDefinition(const std::string &arg) +{ + std::string name; + std::string value; + cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; + + if (cmCacheManager::ParseEntry(arg.c_str(), name, value, type)) + { + this->Definitions[name] = value; + return true; + } + + return false; +} + +//---------------------------------------------------------------------- // the main entry point of ctest, called from main int cmCTest::Run(std::vector<std::string> &args, std::string* output) { @@ -2265,8 +2281,11 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) // into the separate stages if (!this->AddTestsForDashboardType(targ)) { - this->ErrorMessageUnknownDashDValue(targ); - executeTests = false; + if (!this->AddVariableDefinition(targ)) + { + this->ErrorMessageUnknownDashDValue(targ); + executeTests = false; + } } } |