cmCTestGenericHandler.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. 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. #ifndef cmCTestGenericHandler_h
  14. #define cmCTestGenericHandler_h
  15. #include "cmStandardIncludes.h"
  16. class cmCTest;
  17. class cmMakefile;
  18. /** \class cmCTestGenericHandler
  19. * \brief A superclass of all CTest Handlers
  20. *
  21. */
  22. class cmCTestGenericHandler
  23. {
  24. public:
  25. /**
  26. * If verbose then more informaiton is printed out
  27. */
  28. void SetVerbose(bool val) { m_HandlerVerbose = val; }
  29. /**
  30. * Populate internals from CTest custom scripts
  31. */
  32. virtual void PopulateCustomVectors(cmMakefile *) {}
  33. /**
  34. * Do the actual processing. Subclass has to override it.
  35. * Return < 0 if error.
  36. */
  37. virtual int ProcessHandler() = 0;
  38. /**
  39. * Process command line arguments that are applicable for the handler
  40. */
  41. virtual int ProcessCommandLineArguments(
  42. const std::string& /*currentArg*/, size_t& /*idx*/,
  43. const std::vector<std::string>& /*allArgs*/) { return 1; }
  44. /**
  45. * Set the CTest instance
  46. */
  47. void SetCTestInstance(cmCTest* ctest) { m_CTest = ctest; }
  48. cmCTest* GetCTestInstance() { return m_CTest; }
  49. /**
  50. * Construct handler
  51. */
  52. cmCTestGenericHandler();
  53. virtual ~cmCTestGenericHandler();
  54. typedef std::map<cmStdString,cmStdString> t_StringToString;
  55. void SetOption(const char* op, const char* value);
  56. const char* GetOption(const char* op);
  57. protected:
  58. bool m_HandlerVerbose;
  59. cmCTest *m_CTest;
  60. t_StringToString m_Options;
  61. };
  62. #endif