cmCTestBuildAndTestHandler.h 2.3 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 cmCTestBuildAndTestHandler_h
  14. #define cmCTestBuildAndTestHandler_h
  15. #include "cmCTestGenericHandler.h"
  16. #include "cmListFileCache.h"
  17. class cmake;
  18. /** \class cmCTestBuildAndTestHandler
  19. * \brief A class that handles ctest -S invocations
  20. *
  21. */
  22. class cmCTestBuildAndTestHandler : public cmCTestGenericHandler
  23. {
  24. public:
  25. cmTypeMacro(cmCTestBuildAndTestHandler, cmCTestGenericHandler);
  26. /*
  27. * The main entry point for this class
  28. */
  29. int ProcessHandler();
  30. //! Set all the build and test arguments
  31. virtual int ProcessCommandLineArguments(
  32. const std::string& currentArg, size_t& idx,
  33. const std::vector<std::string>& allArgs);
  34. /*
  35. * Get the output variable
  36. */
  37. const char* GetOutput();
  38. cmCTestBuildAndTestHandler();
  39. virtual void Initialize();
  40. protected:
  41. ///! Run CMake and build a test and then run it as a single test.
  42. int RunCMakeAndTest(std::string* output);
  43. int RunCMake(std::string* outstring, cmOStringStream &out,
  44. std::string &cmakeOutString,
  45. std::string &cwd, cmake *cm);
  46. cmStdString m_Output;
  47. std::string m_BuildGenerator;
  48. std::vector<std::string> m_BuildOptions;
  49. bool m_BuildTwoConfig;
  50. std::string m_BuildMakeProgram;
  51. std::string m_SourceDir;
  52. std::string m_BinaryDir;
  53. std::string m_BuildProject;
  54. std::string m_TestCommand;
  55. bool m_BuildNoClean;
  56. std::string m_BuildRunDir;
  57. std::string m_ExecutableDirectory;
  58. std::vector<std::string> m_TestCommandArgs;
  59. std::string m_BuildTarget;
  60. bool m_BuildNoCMake;
  61. };
  62. #endif