From 601764feed24c32ddbe83fa1b3937e925eea10bc Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 3 Apr 2009 11:41:33 -0400 Subject: [PATCH] BUG: Fix documentation deficiency noted in issue #7885. Thanks to Philip Lowman for the gist of the patch. --- Source/cmTest.cxx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) 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."