cmCTestSubmitCommand.cxx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmCTestSubmitCommand.h"
  14. #include "cmCTest.h"
  15. #include "cmCTestGenericHandler.h"
  16. bool cmCTestSubmitCommand::InitialPass(
  17. std::vector<std::string> const& args)
  18. {
  19. if (args.size() != 1)
  20. {
  21. this->SetError("called with incorrect number of arguments");
  22. return false;
  23. }
  24. const char* res_var = args[0].c_str();
  25. m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "DropMethod", "CTEST_DROP_METHOD");
  26. m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "DropSite", "CTEST_DROP_SITE");
  27. m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "DropLocation", "CTEST_DROP_LOCATION");
  28. m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "DropSiteUser", "CTEST_DROP_SITE_USER");
  29. m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "DropSitePassword", "CTEST_DROP_SITE_PASSWORD");
  30. m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "TriggerSite", "CTEST_TRIGGER_SITE");
  31. m_CTest->SetCTestConfigurationFromCMakeVariable(m_Makefile, "ScpCommand", "CTEST_SCP_COMMAND");
  32. cmCTestGenericHandler* handler = m_CTest->GetHandler("submit");
  33. if ( !handler )
  34. {
  35. this->SetError("internal CTest error. Cannot instantiate submit handler");
  36. return false;
  37. }
  38. int res = handler->ProcessHandler();
  39. cmOStringStream str;
  40. str << res;
  41. m_Makefile->AddDefinition(res_var, str.str().c_str());
  42. return true;
  43. }