diff options
author | Brad King <brad.king@kitware.com> | 2009-11-24 13:58:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-11-24 13:58:59 (GMT) |
commit | e1548142fbb582d02f2386ff8085e6372f7f3ffd (patch) | |
tree | 3e65a470050c1e75a2f28a0a9d11371c828d2633 /Source/cmCTest.cxx | |
parent | c2ba35787e4f710d7424c30c61efd1d386d0d619 (diff) | |
download | CMake-e1548142fbb582d02f2386ff8085e6372f7f3ffd.zip CMake-e1548142fbb582d02f2386ff8085e6372f7f3ffd.tar.gz CMake-e1548142fbb582d02f2386ff8085e6372f7f3ffd.tar.bz2 |
CTest: Move initial checkout to ctest_start()
In CTest command-driven script mode we support starting without a source
tree. Previously the ctest_start() command would do some initialization
but could not do anything that required CTestConfig.cmake from the input
source tree. Later, ctest_update() would run CTEST_CHECKOUT_COMMAND to
create the source tree, and then re-initialize everything. This
delayed-initialization approach led to many complicated cases of which
only some worked. For example, the second initialization only worked
correctly in Nightly mode and simply failed for Experimental and
Continuous builds.
A simpler solution is to run CTEST_CHECKOUT_COMMAND during ctest_start()
and then have a single initialization path. In principle this change in
behavior could break scripts that set the checkout command after
ctest_start() but before ctest_update(). However, the convention we've
always followed has been to set all variables before ctest_start().
See issue #9450.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e00c8da..59003be 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -23,6 +23,7 @@ #include "cmXMLSafe.h" #include "cmVersionMacros.h" #include "cmCTestCommand.h" +#include "cmCTestStartCommand.h" #include "cmCTestBuildHandler.h" #include "cmCTestBuildAndTestHandler.h" @@ -452,13 +453,8 @@ int cmCTest::Initialize(const char* binary_dir, bool script) } //---------------------------------------------------------------------- -bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first) +bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) { - if ( !first && !this->CurrentTag.empty() ) - { - return true; - } - std::string src_dir = this->GetCTestConfiguration("SourceDirectory").c_str(); std::string bld_dir = this->GetCTestConfiguration("BuildDirectory").c_str(); @@ -486,17 +482,11 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first) return false; } } - else if ( !first ) + else { cmCTestLog(this, WARNING, "Cannot locate CTest configuration: " << fname.c_str() << std::endl); } - else - { - cmCTestLog(this, HANDLER_OUTPUT, " Cannot locate CTest configuration: " - << fname.c_str() << std::endl - << " Delay the initialization of CTest" << std::endl); - } this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime", "CTEST_NIGHTLY_START_TIME"); @@ -518,10 +508,6 @@ bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first) if ( !this->Initialize(bld_dir.c_str(), true) ) { - if ( this->GetCTestConfiguration("NightlyStartTime").empty() && first) - { - return true; - } return false; } cmCTestLog(this, OUTPUT, " Use " << this->GetTestModelString() |