summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestStartCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmCTestStartCommand.cxx')
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx129
1 files changed, 55 insertions, 74 deletions
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index fef5637..d561393 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -22,14 +22,13 @@ cmCTestStartCommand::cmCTestStartCommand()
this->Quiet = false;
}
-bool cmCTestStartCommand
-::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
+bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
+ cmExecutionStatus&)
{
- if (args.size() < 1)
- {
+ if (args.size() < 1) {
this->SetError("called with incorrect number of arguments");
return false;
- }
+ }
size_t cnt = 0;
const char* smodel = args[cnt].c_str();
@@ -39,62 +38,50 @@ bool cmCTestStartCommand
cnt++;
this->CTest->SetSpecificTrack(0);
- if ( cnt < args.size() -1 )
- {
- if ( args[cnt] == "TRACK" )
- {
- cnt ++;
+ if (cnt < args.size() - 1) {
+ if (args[cnt] == "TRACK") {
+ cnt++;
this->CTest->SetSpecificTrack(args[cnt].c_str());
- cnt ++;
- }
+ cnt++;
}
+ }
- if (cnt < args.size())
- {
- if (args[cnt] == "APPEND")
- {
- cnt ++;
+ if (cnt < args.size()) {
+ if (args[cnt] == "APPEND") {
+ cnt++;
this->CreateNewTag = false;
- }
}
- if (cnt < args.size())
- {
- if (args[cnt] == "QUIET")
- {
- cnt ++;
+ }
+ if (cnt < args.size()) {
+ if (args[cnt] == "QUIET") {
+ cnt++;
this->Quiet = true;
- }
}
+ }
- if ( cnt < args.size() )
- {
+ if (cnt < args.size()) {
src_dir = args[cnt].c_str();
- cnt ++;
- if ( cnt < args.size() )
- {
+ cnt++;
+ if (cnt < args.size()) {
bld_dir = args[cnt].c_str();
- }
}
- if ( !src_dir )
- {
+ }
+ if (!src_dir) {
src_dir = this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY");
- }
- if ( !bld_dir)
- {
+ }
+ if (!bld_dir) {
bld_dir = this->Makefile->GetDefinition("CTEST_BINARY_DIRECTORY");
- }
- if ( !src_dir )
- {
+ }
+ if (!src_dir) {
this->SetError("source directory not specified. Specify source directory "
- "as an argument or set CTEST_SOURCE_DIRECTORY");
+ "as an argument or set CTEST_SOURCE_DIRECTORY");
return false;
- }
- if ( !bld_dir)
- {
+ }
+ if (!bld_dir) {
this->SetError("binary directory not specified. Specify binary directory "
- "as an argument or set CTEST_BINARY_DIRECTORY");
+ "as an argument or set CTEST_BINARY_DIRECTORY");
return false;
- }
+ }
cmSystemTools::AddKeepPath(src_dir);
cmSystemTools::AddKeepPath(bld_dir);
@@ -104,38 +91,35 @@ bool cmCTestStartCommand
std::string sourceDir = cmSystemTools::CollapseFullPath(src_dir);
std::string binaryDir = cmSystemTools::CollapseFullPath(bld_dir);
this->CTest->SetCTestConfiguration("SourceDirectory", sourceDir.c_str(),
- this->Quiet);
+ this->Quiet);
this->CTest->SetCTestConfiguration("BuildDirectory", binaryDir.c_str(),
- this->Quiet);
+ this->Quiet);
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Run dashboard with model "
- << smodel << std::endl
- << " Source directory: " << src_dir << std::endl
- << " Build directory: " << bld_dir << std::endl, this->Quiet);
+ << smodel << std::endl
+ << " Source directory: " << src_dir << std::endl
+ << " Build directory: " << bld_dir << std::endl,
+ this->Quiet);
const char* track = this->CTest->GetSpecificTrack();
- if ( track )
- {
+ if (track) {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Track: " << track << std::endl, this->Quiet);
- }
+ " Track: " << track << std::endl, this->Quiet);
+ }
// Log startup actions.
std::string startLogFile = binaryDir + "/Testing/Temporary/LastStart.log";
cmGeneratedFileStream ofs(startLogFile.c_str());
- if(!ofs)
- {
+ if (!ofs) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot create log file: LastStart.log" << std::endl);
return false;
- }
+ }
// Make sure the source directory exists.
- if(!this->InitialCheckout(ofs, sourceDir))
- {
+ if (!this->InitialCheckout(ofs, sourceDir)) {
return false;
- }
- if(!cmSystemTools::FileIsDirectory(sourceDir))
- {
+ }
+ if (!cmSystemTools::FileIsDirectory(sourceDir)) {
std::ostringstream e;
e << "given source path\n"
<< " " << sourceDir << "\n"
@@ -143,7 +127,7 @@ bool cmCTestStartCommand
<< "Set CTEST_CHECKOUT_COMMAND to a command line to create it.";
this->SetError(e.str());
return false;
- }
+ }
this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", "OFF");
this->CTest->SetSuppressUpdatingCTestConfiguration(true);
@@ -154,26 +138,23 @@ bool cmCTestStartCommand
return this->CTest->InitializeFromCommand(this);
}
-bool cmCTestStartCommand::InitialCheckout(
- std::ostream& ofs, std::string const& sourceDir)
+bool cmCTestStartCommand::InitialCheckout(std::ostream& ofs,
+ std::string const& sourceDir)
{
// Use the user-provided command to create the source tree.
- const char* initialCheckoutCommand
- = this->Makefile->GetDefinition("CTEST_CHECKOUT_COMMAND");
- if(!initialCheckoutCommand)
- {
+ const char* initialCheckoutCommand =
+ this->Makefile->GetDefinition("CTEST_CHECKOUT_COMMAND");
+ if (!initialCheckoutCommand) {
initialCheckoutCommand =
this->Makefile->GetDefinition("CTEST_CVS_CHECKOUT");
- }
- if(initialCheckoutCommand)
- {
+ }
+ if (initialCheckoutCommand) {
// Use a generic VC object to run and log the command.
cmCTestVC vc(this->CTest, ofs);
vc.SetSourceDirectory(sourceDir);
- if(!vc.InitialCheckout(initialCheckoutCommand))
- {
+ if (!vc.InitialCheckout(initialCheckoutCommand)) {
return false;
- }
}
+ }
return true;
}