summaryrefslogtreecommitdiffstats
path: root/Source/cmTest.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-31 15:51:42 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-31 15:51:42 (GMT)
commitbebc745824920465c9df5fee9baf9b6f8a35d34f (patch)
tree958f9a784bd1aa1960fcd318d6123b5c928a0dc0 /Source/cmTest.cxx
parentec3f3b5a2db2c0d60fe2dbe31b21cf937fc8264e (diff)
downloadCMake-bebc745824920465c9df5fee9baf9b6f8a35d34f.zip
CMake-bebc745824920465c9df5fee9baf9b6f8a35d34f.tar.gz
CMake-bebc745824920465c9df5fee9baf9b6f8a35d34f.tar.bz2
ENH: Add set and get test propety command
Diffstat (limited to 'Source/cmTest.cxx')
-rw-r--r--Source/cmTest.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index bf999fe..ccef841 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -49,3 +49,38 @@ void cmTest::SetArguments(const std::vector<cmStdString>& args)
m_Args = args;
}
+const char *cmTest::GetProperty(const char* prop) const
+{
+ std::map<cmStdString,cmStdString>::const_iterator i =
+ m_Properties.find(prop);
+ if (i != m_Properties.end())
+ {
+ return i->second.c_str();
+ }
+ return 0;
+}
+
+bool cmTest::GetPropertyAsBool(const char* prop) const
+{
+ std::map<cmStdString,cmStdString>::const_iterator i =
+ m_Properties.find(prop);
+ if (i != m_Properties.end())
+ {
+ return cmSystemTools::IsOn(i->second.c_str());
+ }
+ return false;
+}
+
+void cmTest::SetProperty(const char* prop, const char* value)
+{
+ if (!prop)
+ {
+ return;
+ }
+ if (!value)
+ {
+ value = "NOTFOUND";
+ }
+ m_Properties[prop] = value;
+}
+