summaryrefslogtreecommitdiffstats
path: root/Source/cmTest.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2009-04-03 15:41:33 (GMT)
committerDavid Cole <david.cole@kitware.com>2009-04-03 15:41:33 (GMT)
commit601764feed24c32ddbe83fa1b3937e925eea10bc (patch)
tree2696ecb2ea2d4cbb9983e28c064a78e5b4ec8db9 /Source/cmTest.cxx
parent17ea632e93d5dd9bb0e75c0e69141d969fe4d0bc (diff)
downloadCMake-601764feed24c32ddbe83fa1b3937e925eea10bc.zip
CMake-601764feed24c32ddbe83fa1b3937e925eea10bc.tar.gz
CMake-601764feed24c32ddbe83fa1b3937e925eea10bc.tar.bz2
BUG: Fix documentation deficiency noted in issue #7885. Thanks to Philip Lowman for the gist of the patch.
Diffstat (limited to 'Source/cmTest.cxx')
-rw-r--r--Source/cmTest.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index a4e8bf7..052278e 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -20,16 +20,19 @@
#include "cmake.h"
#include "cmMakefile.h"
+//----------------------------------------------------------------------------
cmTest::cmTest()
{
this->Makefile = 0;
this->OldStyle = true;
}
+//----------------------------------------------------------------------------
cmTest::~cmTest()
{
}
+//----------------------------------------------------------------------------
void cmTest::SetName(const char* name)
{
if ( !name )
@@ -39,11 +42,13 @@ void cmTest::SetName(const char* name)
this->Name = name;
}
+//----------------------------------------------------------------------------
void cmTest::SetCommand(std::vector<std::string> const& command)
{
this->Command = command;
}
+//----------------------------------------------------------------------------
const char *cmTest::GetProperty(const char* prop) const
{
bool chain = false;
@@ -56,11 +61,13 @@ const char *cmTest::GetProperty(const char* prop) const
return retVal;
}
+//----------------------------------------------------------------------------
bool cmTest::GetPropertyAsBool(const char* prop) const
{
return cmSystemTools::IsOn(this->GetProperty(prop));
}
+//----------------------------------------------------------------------------
void cmTest::SetProperty(const char* prop, const char* value)
{
if (!prop)
@@ -84,17 +91,24 @@ void cmTest::AppendProperty(const char* prop, const char* value)
//----------------------------------------------------------------------------
void cmTest::SetMakefile(cmMakefile* mf)
{
- // Set our makefile.
this->Makefile = mf;
this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
}
-// define properties
+//----------------------------------------------------------------------------
void cmTest::DefineProperties(cmake *cm)
{
- // define properties
cm->DefineProperty
- ("FAIL_REGULAR_EXPRESSION", cmProperty::TEST,
+ ("ENVIRONMENT", cmProperty::TEST,
+ "Specify environment variables that should be defined for running "
+ "a test.",
+ "If set to a list of environment variables and values of the form "
+ "MYVAR=value those environment variables will be defined while "
+ "running the test. The environment is restored to its previous state "
+ "after the test is done.");
+
+ cm->DefineProperty
+ ("FAIL_REGULAR_EXPRESSION", cmProperty::TEST,
"If the output matches this regular expression the test will fail.",
"If set, if the output matches one of "
"specified regular expressions, the test will fail."