diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-16 17:18:21 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-16 17:18:21 (GMT) |
commit | 2cc5ed49d17e5a26308d3af288767e7ef405903b (patch) | |
tree | a918403b8c04e6058785876c71e8b79cffd36948 /Source/CTest/cmCTestUpdateCommand.cxx | |
parent | b156314ab3cedc7fa1c8198a320be4a05dd6ff8d (diff) | |
download | CMake-2cc5ed49d17e5a26308d3af288767e7ef405903b.zip CMake-2cc5ed49d17e5a26308d3af288767e7ef405903b.tar.gz CMake-2cc5ed49d17e5a26308d3af288767e7ef405903b.tar.bz2 |
ENH: Several improvements to CTest:
1. Support for showing line numbers when debugging ctest --show-line-numbers
2. Modify the ctest initialization code, so that it can be delayed
3. Handlers now have corresponding command if they were invoked from the command (so far only update actually use that)
4. Start command is simplified and the functionality is moved to CTest
5. Update can perform initial checkout if CTEST_CHECKOUT_COMMAND is set
6. Add test that checks out kwsys and perform tests on the fresh checkout
Diffstat (limited to 'Source/CTest/cmCTestUpdateCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestUpdateCommand.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx index c0e00ae..15b9e90 100644 --- a/Source/CTest/cmCTestUpdateCommand.cxx +++ b/Source/CTest/cmCTestUpdateCommand.cxx @@ -69,16 +69,41 @@ bool cmCTestUpdateCommand::InitialPass( m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "CVSCommand", "CTEST_CVS_COMMAND"); m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "SVNCommand", "CTEST_SVN_COMMAND"); + const char* initialCheckoutCommand = m_Makefile->GetDefinition("CTEST_CHECKOUT_COMMAND"); + if ( !initialCheckoutCommand ) + { + initialCheckoutCommand = m_Makefile->GetDefinition("CTEST_CVS_CHECKOUT"); + } + cmCTestGenericHandler* handler = m_CTest->GetHandler("update"); if ( !handler ) { this->SetError("internal CTest error. Cannot instantiate update handler"); return false; } - if ( source_dir ) + handler->SetCommand(this); + if ( !source_dir ) + { + this->SetError("source directory not specified. Please use SOURCE tag"); + return false; + } + if ( initialCheckoutCommand ) { - handler->SetOption("SourceDirectory", source_dir); + handler->SetOption("InitialCheckout", initialCheckoutCommand); + } + if ( (!cmSystemTools::FileExists(source_dir) || !cmSystemTools::FileIsDirectory(source_dir)) + && !initialCheckoutCommand ) + { + cmOStringStream str; + str << "cannot find source directory: " << source_dir << "."; + if ( !cmSystemTools::FileExists(source_dir) ) + { + str << " Looks like it is not checked out yet. Please specify CTEST_CHECKOUT_COMMAND."; + } + this->SetError(str.str().c_str()); + return false; } + handler->SetOption("SourceDirectory", source_dir); int res = handler->ProcessHandler(); if ( res_var ) { |