summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-03-28 14:05:42 (GMT)
committerBrad King <brad.king@kitware.com>2013-04-12 15:35:36 (GMT)
commita6c0299c407bc4482140637c0460f71238b4f9d0 (patch)
tree2aa0057e1e82368470e5bf0a50a33bcf93317101 /Source/CTest
parent1ca93182ad37f6f90ceb0b2a5faaa21ef58ba7e2 (diff)
downloadCMake-a6c0299c407bc4482140637c0460f71238b4f9d0.zip
CMake-a6c0299c407bc4482140637c0460f71238b4f9d0.tar.gz
CMake-a6c0299c407bc4482140637c0460f71238b4f9d0.tar.bz2
CTest: Simplify ctest_* command source/build dir lookup
In cmCTestHandlerCommand::InitialPass call InitializeHandler after setting the CTest "SourceDirectory" and "BuildDirectory" configuration values instead of before. This makes the values available to InitializeHandler methods in subclasses, so also drop the duplicate configuration of those values from cmCTestConfigureCommand::InitializeHandler.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx26
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx27
2 files changed, 14 insertions, 39 deletions
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index d6d39a9..db33cb6 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -31,32 +31,6 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmSystemTools::ExpandListArgument(this->Values[ctc_OPTIONS], options);
}
- if ( this->Values[ct_BUILD] )
- {
- this->CTest->SetCTestConfiguration("BuildDirectory",
- cmSystemTools::CollapseFullPath(
- this->Values[ct_BUILD]).c_str());
- }
- else
- {
- this->CTest->SetCTestConfiguration("BuildDirectory",
- cmSystemTools::CollapseFullPath(
- this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY")).c_str());
- }
-
- if ( this->Values[ct_SOURCE] )
- {
- this->CTest->SetCTestConfiguration("SourceDirectory",
- cmSystemTools::CollapseFullPath(
- this->Values[ct_SOURCE]).c_str());
- }
- else
- {
- this->CTest->SetCTestConfiguration("SourceDirectory",
- cmSystemTools::CollapseFullPath(
- this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
- }
-
if ( this->CTest->GetCTestConfiguration("BuildDirectory").empty() )
{
this->SetError("Build directory not specified. Either use BUILD "
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 453e32c..2e2feb0 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -70,19 +70,6 @@ bool cmCTestHandlerCommand
this->CTest->SetConfigType(ctestConfigType);
}
- cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;);
- cmCTestGenericHandler* handler = this->InitializeHandler();
- if ( !handler )
- {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Cannot instantiate test handler " << this->GetName()
- << std::endl);
- return false;
- }
-
- handler->SetAppendXML(this->AppendXML);
-
- handler->PopulateCustomVectors(this->Makefile);
if ( this->Values[ct_BUILD] )
{
this->CTest->SetCTestConfiguration("BuildDirectory",
@@ -119,6 +106,20 @@ bool cmCTestHandlerCommand
cmSystemTools::CollapseFullPath(
this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")).c_str());
}
+
+ cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;);
+ cmCTestGenericHandler* handler = this->InitializeHandler();
+ if ( !handler )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot instantiate test handler " << this->GetName()
+ << std::endl);
+ return false;
+ }
+
+ handler->SetAppendXML(this->AppendXML);
+
+ handler->PopulateCustomVectors(this->Makefile);
if ( this->Values[ct_SUBMIT_INDEX] )
{
if(!this->CTest->GetDropSiteCDash() && this->CTest->GetDartVersion() <= 1)