cmCTestTestCommand.cxx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 "cmCTestTestCommand.h"
  14. #include "cmCTest.h"
  15. #include "cmCTestGenericHandler.h"
  16. cmCTestTestCommand::cmCTestTestCommand()
  17. {
  18. m_Arguments[ctt_START] = "START";
  19. m_Arguments[ctt_END] = "END";
  20. m_Arguments[ctt_STRIDE] = "STRIDE";
  21. m_Arguments[ctt_LAST] = 0;
  22. m_Last = ctt_LAST;
  23. }
  24. cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
  25. {
  26. cmCTestGenericHandler* handler = m_CTest->GetInitializedHandler("test");
  27. if ( m_Values[ctt_START] || m_Values[ctt_END] || m_Values[ctt_STRIDE] )
  28. {
  29. cmOStringStream testsToRunString;
  30. if ( m_Values[ctt_START] )
  31. {
  32. testsToRunString << m_Values[ctt_START];
  33. }
  34. testsToRunString << ",";
  35. if ( m_Values[ctt_END] )
  36. {
  37. testsToRunString << m_Values[ctt_END];
  38. }
  39. testsToRunString << ",";
  40. if ( m_Values[ctt_STRIDE] )
  41. {
  42. testsToRunString << m_Values[ctt_STRIDE];
  43. }
  44. handler->SetOption("TestsToRunInformation", testsToRunString.str().c_str());
  45. }
  46. return handler;
  47. }
  48. cmCTestGenericHandler* cmCTestTestCommand::InitializeActualHandler()
  49. {
  50. return m_CTest->GetInitializedHandler("test");
  51. }