BUG: Fix documentation deficiency noted in issue #7885. Thanks to Philip Lowman for the gist of the patch.

This commit is contained in:
David Cole 2009-04-03 11:41:33 -04:00
parent 17ea632e93
commit 601764feed
1 changed files with 18 additions and 4 deletions

View File

@ -20,16 +20,19 @@
#include "cmake.h" #include "cmake.h"
#include "cmMakefile.h" #include "cmMakefile.h"
//----------------------------------------------------------------------------
cmTest::cmTest() cmTest::cmTest()
{ {
this->Makefile = 0; this->Makefile = 0;
this->OldStyle = true; this->OldStyle = true;
} }
//----------------------------------------------------------------------------
cmTest::~cmTest() cmTest::~cmTest()
{ {
} }
//----------------------------------------------------------------------------
void cmTest::SetName(const char* name) void cmTest::SetName(const char* name)
{ {
if ( !name ) if ( !name )
@ -39,11 +42,13 @@ void cmTest::SetName(const char* name)
this->Name = name; this->Name = name;
} }
//----------------------------------------------------------------------------
void cmTest::SetCommand(std::vector<std::string> const& command) void cmTest::SetCommand(std::vector<std::string> const& command)
{ {
this->Command = command; this->Command = command;
} }
//----------------------------------------------------------------------------
const char *cmTest::GetProperty(const char* prop) const const char *cmTest::GetProperty(const char* prop) const
{ {
bool chain = false; bool chain = false;
@ -56,11 +61,13 @@ const char *cmTest::GetProperty(const char* prop) const
return retVal; return retVal;
} }
//----------------------------------------------------------------------------
bool cmTest::GetPropertyAsBool(const char* prop) const bool cmTest::GetPropertyAsBool(const char* prop) const
{ {
return cmSystemTools::IsOn(this->GetProperty(prop)); return cmSystemTools::IsOn(this->GetProperty(prop));
} }
//----------------------------------------------------------------------------
void cmTest::SetProperty(const char* prop, const char* value) void cmTest::SetProperty(const char* prop, const char* value)
{ {
if (!prop) if (!prop)
@ -84,17 +91,24 @@ void cmTest::AppendProperty(const char* prop, const char* value)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTest::SetMakefile(cmMakefile* mf) void cmTest::SetMakefile(cmMakefile* mf)
{ {
// Set our makefile.
this->Makefile = mf; this->Makefile = mf;
this->Properties.SetCMakeInstance(mf->GetCMakeInstance()); this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
} }
// define properties //----------------------------------------------------------------------------
void cmTest::DefineProperties(cmake *cm) void cmTest::DefineProperties(cmake *cm)
{ {
// define properties
cm->DefineProperty 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 the output matches this regular expression the test will fail.",
"If set, if the output matches one of " "If set, if the output matches one of "
"specified regular expressions, the test will fail." "specified regular expressions, the test will fail."