cmCTestBuildAndTestHandler.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCTestBuildAndTestHandler_h
  4. #define cmCTestBuildAndTestHandler_h
  5. #include <cmConfigure.h>
  6. #include "cmCTestGenericHandler.h"
  7. #include <sstream>
  8. #include <stddef.h>
  9. #include <string>
  10. #include <vector>
  11. class cmake;
  12. /** \class cmCTestBuildAndTestHandler
  13. * \brief A class that handles ctest -S invocations
  14. *
  15. */
  16. class cmCTestBuildAndTestHandler : public cmCTestGenericHandler
  17. {
  18. public:
  19. typedef cmCTestGenericHandler Superclass;
  20. /*
  21. * The main entry point for this class
  22. */
  23. int ProcessHandler() CM_OVERRIDE;
  24. //! Set all the build and test arguments
  25. int ProcessCommandLineArguments(const std::string& currentArg, size_t& idx,
  26. const std::vector<std::string>& allArgs)
  27. CM_OVERRIDE;
  28. /*
  29. * Get the output variable
  30. */
  31. const char* GetOutput();
  32. cmCTestBuildAndTestHandler();
  33. void Initialize() CM_OVERRIDE;
  34. protected:
  35. ///! Run CMake and build a test and then run it as a single test.
  36. int RunCMakeAndTest(std::string* output);
  37. int RunCMake(std::string* outstring, std::ostringstream& out,
  38. std::string& cmakeOutString, cmake* cm);
  39. std::string Output;
  40. std::string BuildGenerator;
  41. std::string BuildGeneratorPlatform;
  42. std::string BuildGeneratorToolset;
  43. std::vector<std::string> BuildOptions;
  44. bool BuildTwoConfig;
  45. std::string BuildMakeProgram;
  46. std::string ConfigSample;
  47. std::string SourceDir;
  48. std::string BinaryDir;
  49. std::string BuildProject;
  50. std::string TestCommand;
  51. bool BuildNoClean;
  52. std::string BuildRunDir;
  53. std::string ExecutableDirectory;
  54. std::vector<std::string> TestCommandArgs;
  55. std::vector<std::string> BuildTargets;
  56. bool BuildNoCMake;
  57. double Timeout;
  58. };
  59. #endif