diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index a4e8bf726..052278eba 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 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."