diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-29 17:01:24 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-29 17:01:24 (GMT) |
commit | 386900bfdd5836ccabeb0c050a6292c50aec79d6 (patch) | |
tree | 8316484c17eb5201a18f11ee8ff6245ae29ce365 /Source/CTest/cmCTestCoverageCommand.cxx | |
parent | b75166ea45173f8bc2cb9076f511a51b8112f61b (diff) | |
download | CMake-386900bfdd5836ccabeb0c050a6292c50aec79d6.zip CMake-386900bfdd5836ccabeb0c050a6292c50aec79d6.tar.gz CMake-386900bfdd5836ccabeb0c050a6292c50aec79d6.tar.bz2 |
ENH: Several cleanups and make sure things get propagated where they should. Also, allow to load CTest custom files to the actual ctest -S script
Diffstat (limited to 'Source/CTest/cmCTestCoverageCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestCoverageCommand.cxx | 68 |
1 files changed, 2 insertions, 66 deletions
diff --git a/Source/CTest/cmCTestCoverageCommand.cxx b/Source/CTest/cmCTestCoverageCommand.cxx index c70c4cf..b97e0b2 100644 --- a/Source/CTest/cmCTestCoverageCommand.cxx +++ b/Source/CTest/cmCTestCoverageCommand.cxx @@ -19,61 +19,8 @@ #include "cmCTest.h" #include "cmCTestGenericHandler.h" -bool cmCTestCoverageCommand::InitialPass( - std::vector<std::string> const& args) +cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler() { - const char* build_dir = 0; - const char* res_var = 0; - - bool havereturn_variable = false; - bool havesource = false; - for(size_t i=0; i < args.size(); ++i) - { - if ( havereturn_variable ) - { - res_var = args[i].c_str(); - havereturn_variable = false; - } - else if ( havesource ) - { - build_dir = args[i].c_str(); - havesource = false; - } - else if(args[i] == "RETURN_VALUE") - { - if ( res_var ) - { - this->SetError("called with incorrect number of arguments. " - "RETURN_VALUE specified twice."); - return false; - } - havereturn_variable = true; - } - else if(args[i] == "BUILD") - { - if ( build_dir ) - { - this->SetError("called with incorrect number of arguments. " - "BUILD specified twice."); - return false; - } - havesource = true; - } - else - { - cmOStringStream str; - str << "called with incorrect number of arguments. Extra argument is: " - << args[i].c_str() << "."; - this->SetError(str.str().c_str()); - return false; - } - } - - if ( build_dir ) - { - this->CTest->SetCTestConfiguration("BuildDirectory", build_dir); - } - this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "CoverageCommand", "CTEST_COVERAGE_COMMAND"); @@ -84,18 +31,7 @@ bool cmCTestCoverageCommand::InitialPass( this->SetError("internal CTest error. Cannot instantiate test handler"); return false; } - std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory( - this->CTest->GetCTestConfiguration("BuildDirectory").c_str()); - int res = handler->ProcessHandler(); - if ( res_var ) - { - cmOStringStream str; - str << res; - this->Makefile->AddDefinition(res_var, str.str().c_str()); - } - cmSystemTools::ChangeDirectory(current_dir.c_str()); - return true; + return handler; } |