summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx23
-rw-r--r--Source/CTest/cmCTestStartCommand.h10
-rw-r--r--Source/cmCTest.cxx76
3 files changed, 69 insertions, 40 deletions
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index 8ea6cef..e19e4f4 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -20,6 +20,7 @@
cmCTestStartCommand::cmCTestStartCommand()
{
this->CreateNewTag = true;
+ this->Quiet = false;
}
bool cmCTestStartCommand
@@ -57,6 +58,14 @@ bool cmCTestStartCommand
this->CreateNewTag = false;
}
}
+ if (cnt < args.size())
+ {
+ if (args[cnt] == "QUIET")
+ {
+ cnt ++;
+ this->Quiet = true;
+ }
+ }
if ( cnt < args.size() )
{
@@ -95,18 +104,20 @@ bool cmCTestStartCommand
std::string sourceDir = cmSystemTools::CollapseFullPath(src_dir);
std::string binaryDir = cmSystemTools::CollapseFullPath(bld_dir);
- this->CTest->SetCTestConfiguration("SourceDirectory", sourceDir.c_str());
- this->CTest->SetCTestConfiguration("BuildDirectory", binaryDir.c_str());
+ this->CTest->SetCTestConfiguration("SourceDirectory", sourceDir.c_str(),
+ this->Quiet);
+ this->CTest->SetCTestConfiguration("BuildDirectory", binaryDir.c_str(),
+ this->Quiet);
- cmCTestLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with model "
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with model "
<< smodel << std::endl
<< " Source directory: " << src_dir << std::endl
- << " Build directory: " << bld_dir << std::endl);
+ << " Build directory: " << bld_dir << std::endl, this->Quiet);
const char* track = this->CTest->GetSpecificTrack();
if ( track )
{
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
- " Track: " << track << std::endl);
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " Track: " << track << std::endl, this->Quiet);
}
// Log startup actions.
diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h
index 3b8843f..eed1962 100644
--- a/Source/CTest/cmCTestStartCommand.h
+++ b/Source/CTest/cmCTestStartCommand.h
@@ -34,6 +34,7 @@ public:
ni->CTest = this->CTest;
ni->CTestScriptHandler = this->CTestScriptHandler;
ni->CreateNewTag = this->CreateNewTag;
+ ni->Quiet = this->Quiet;
return ni;
}
@@ -53,6 +54,14 @@ public:
}
/**
+ * Should this invocation of ctest_start output non-error messages?
+ */
+ bool ShouldBeQuiet()
+ {
+ return this->Quiet;
+ }
+
+ /**
* The name of the command as specified in CMakeList.txt.
*/
virtual std::string GetName() const { return "ctest_start";}
@@ -62,6 +71,7 @@ public:
private:
bool InitialCheckout(std::ostream& ofs, std::string const& sourceDir);
bool CreateNewTag;
+ bool Quiet;
};
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 9975802..d7fe22d 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -463,7 +463,13 @@ cmCTest::Part cmCTest::GetPartFromName(const char* name)
//----------------------------------------------------------------------
int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
{
- cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
+ bool quiet = false;
+ if (command && command->ShouldBeQuiet())
+ {
+ quiet = true;
+ }
+
+ cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl, quiet);
if(!this->InteractiveDebugMode)
{
this->BlockTestErrorDiagnostics();
@@ -478,24 +484,23 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
this->UpdateCTestConfiguration();
- cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
+ cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl, quiet);
if ( this->ProduceXML )
{
- cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
- cmCTestLog(this, OUTPUT,
- " Site: " << this->GetCTestConfiguration("Site") << std::endl
- << " Build name: "
- << cmCTest::SafeBuildIdField(
- this->GetCTestConfiguration("BuildName"))
- << std::endl);
- cmCTestLog(this, DEBUG, "Produce XML is on" << std::endl);
+ cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl, quiet);
+ cmCTestOptionalLog(this, OUTPUT,
+ " Site: " << this->GetCTestConfiguration("Site") << std::endl <<
+ " Build name: " << cmCTest::SafeBuildIdField(
+ this->GetCTestConfiguration("BuildName")) << std::endl, quiet);
+ cmCTestOptionalLog(this, DEBUG, "Produce XML is on" << std::endl, quiet);
if ( this->TestModel == cmCTest::NIGHTLY &&
this->GetCTestConfiguration("NightlyStartTime").empty() )
{
- cmCTestLog(this, WARNING,
- "WARNING: No nightly start time found please set in"
- " CTestConfig.cmake or DartConfig.cmake" << std::endl);
- cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
+ cmCTestOptionalLog(this, WARNING,
+ "WARNING: No nightly start time found please set in CTestConfig.cmake"
+ " or DartConfig.cmake" << std::endl, quiet);
+ cmCTestOptionalLog(this, DEBUG, "Here: " << __LINE__ << std::endl,
+ quiet);
return 0;
}
}
@@ -507,8 +512,8 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
cmMakefile *mf = lg->GetMakefile();
if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf) )
{
- cmCTestLog(this, DEBUG, "Cannot find custom configuration file tree"
- << std::endl);
+ cmCTestOptionalLog(this, DEBUG,
+ "Cannot find custom configuration file tree" << std::endl, quiet);
return 0;
}
@@ -583,9 +588,10 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
if (tag.empty() || (0 != command) || this->Parts[PartStart])
{
- cmCTestLog(this, DEBUG, "TestModel: " << this->GetTestModelString()
- << std::endl);
- cmCTestLog(this, DEBUG, "TestModel: " << this->TestModel << std::endl);
+ cmCTestOptionalLog(this, DEBUG, "TestModel: " <<
+ this->GetTestModelString() << std::endl, quiet);
+ cmCTestOptionalLog(this, DEBUG, "TestModel: " <<
+ this->TestModel << std::endl, quiet);
if ( this->TestModel == cmCTest::NIGHTLY )
{
lctime = this->GetNightlyTime(
@@ -609,8 +615,8 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
ofs.close();
if ( 0 == command )
{
- cmCTestLog(this, OUTPUT, "Create new tag: " << tag << " - "
- << this->GetTestModelString() << std::endl);
+ cmCTestOptionalLog(this, OUTPUT, "Create new tag: " << tag << " - "
+ << this->GetTestModelString() << std::endl, quiet);
}
}
}
@@ -630,8 +636,8 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
return 0;
}
- cmCTestLog(this, OUTPUT, " Use existing tag: " << tag << " - "
- << this->GetTestModelString() << std::endl);
+ cmCTestOptionalLog(this, OUTPUT, " Use existing tag: " << tag << " - "
+ << this->GetTestModelString() << std::endl, quiet);
}
this->CurrentTag = tag;
@@ -675,8 +681,8 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
if ( !fname.empty() )
{
- cmCTestLog(this, OUTPUT, " Reading ctest configuration file: "
- << fname << std::endl);
+ cmCTestOptionalLog(this, OUTPUT, " Reading ctest configuration file: "
+ << fname << std::endl, command->ShouldBeQuiet());
bool readit = mf->ReadListFile(mf->GetCurrentListFile(),
fname.c_str() );
if(!readit)
@@ -689,19 +695,20 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
}
else
{
- cmCTestLog(this, WARNING,
+ cmCTestOptionalLog(this, WARNING,
"Cannot locate CTest configuration: in BuildDirectory: "
- << bld_dir_fname << std::endl);
- cmCTestLog(this, WARNING,
+ << bld_dir_fname << std::endl, command->ShouldBeQuiet());
+ cmCTestOptionalLog(this, WARNING,
"Cannot locate CTest configuration: in SourceDirectory: "
- << src_dir_fname << std::endl);
+ << src_dir_fname << std::endl, command->ShouldBeQuiet());
}
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",
- "CTEST_NIGHTLY_START_TIME");
- this->SetCTestConfigurationFromCMakeVariable(mf, "Site", "CTEST_SITE");
+ "CTEST_NIGHTLY_START_TIME", command->ShouldBeQuiet());
+ this->SetCTestConfigurationFromCMakeVariable(mf, "Site", "CTEST_SITE",
+ command->ShouldBeQuiet());
this->SetCTestConfigurationFromCMakeVariable(mf, "BuildName",
- "CTEST_BUILD_NAME");
+ "CTEST_BUILD_NAME", command->ShouldBeQuiet());
const char* dartVersion = mf->GetDefinition("CTEST_DART_SERVER_VERSION");
if ( dartVersion )
{
@@ -720,8 +727,9 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
{
return false;
}
- cmCTestLog(this, OUTPUT, " Use " << this->GetTestModelString()
- << " tag: " << this->GetCurrentTag() << std::endl);
+ cmCTestOptionalLog(this, OUTPUT, " Use " << this->GetTestModelString()
+ << " tag: " << this->GetCurrentTag() << std::endl,
+ command->ShouldBeQuiet());
return true;
}